From: Dmitry A. Soshnikov on
On Oct 29, 1:48 pm, Thomas 'PointedEars' Lahn <PointedE...(a)web.de>
wrote:
> kangax wrote:
> > Thomas 'PointedEars' Lahn wrote:
> >> kangax wrote:
> >>> Thomas 'PointedEars' Lahn wrote:
> >>>> kangax wrote:
> >>>>> Thomas 'PointedEars' Lahn wrote:
> >>>>>> kangax wrote:
> >>>>>>> Are you sure you haven't missed anything?
>
> >>>>>>> "I would like to create own Object that would behave similar to
> >>>>>>> Array Object, but would have defined some methods that are not in
> >>>>>>> current
> >>>>>>>                                                       ^^^^^^^^^^^^^^
> >>>>>>> Array implementation. It need to not touch .prototype of an Array,
> >>>>>>> so it
> >>>>>>> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> >>>>>>> should work like this"
> >>>>>> So the thread has drifted a bit.  Your approach touches ".prototype
> >>>>>> of an
> >>>>>> Array", too.  That you are using `__proto__' to refer to said object
> >>>>>> instead, does not change that.
> >>>>> Doesn't OP example make it clear what was meant by "touches"? If I
> >>>>> understood it right, the snippet with __proto__ setting doesn't
> >>>>> "touch" `Array.prototype`.
> >>>> But the OP did not say "not use Array.prototype" to begin with; they
> >>>> said:
> >>> Of course he did.
>
> >> Not in what you quoted.
>
> >>> You just seem to have missed it again.
>
> >> Or maybe I understood the OP differently?
>
> > Ok.
>
> >>> Look at the second comment of OP's example.
>
> >> You did not quote that; Richard did, and it is hardly relevant.
>
> > Should I quote specific lines every time? Are you not able to understand
> > the issue as a whole? Everyone seemed to have understood OP identically
> > (more or less), except you.
>
> They did not.  In any case:
>
>   The fact that an opinion has been widely held is no evidence whatever that
>   it is not utterly absurd; indeed in view of the silliness of the majority
>   of mankind, a widespread belief is more likely to be foolish than
>   sensible.
>     -- Bertrand Russell (1872-1970 CE)
>

Man, sorry, but you're just collection of "authority" cites ;) Do you
have your own opinion? I mean beside your shor "No.", "The did not.",
"No they are not" and so on - pathos phrases of those who belive
himself higher that other. Decrease your pathos, I repeat, it really
will be better ;)


> [...]
> > You're joking, right? :)
>
> I do not.
>

One more time :) "You do not". "No.", "They do not.", "Everybody's
lie.", "No." ;)

> >>> Now look a bit further down:
>
> >>> var c = new SuperArray([2,4,6]);
> >>> [...]
> >>> c.someAddedFunction(); // calls function
> >>>                            ^^^^^^^^^^^^^^
>
> >>> How more clear should it be?
>
> >> "Array.prototype", but that would still be ambiguous (AISB).
>
> > Oh, come on.
>
> Is that supposed to be an argument?
>

What argument do you expect else in case of your troll-like style
speaking (I mean concrete this one thread)?


> [...]
> In any case, both approaches fail to address the requirement of "not
> touch[ing] the .prototype of an Array".  The resulting Array instance will
> inherit enumerable properties that show up in for-in iteration.
>

You still continue to sing your song, just because you can't say
(yeah, I understand - it's hard, when you believe yourself higher than
other ;)) - "sorry, guys, I did't understand it correctly", you still
continue talking about stupid "the .prototype of an Array" ===
"[[Prototype]] of []" without listening kangax.

k, one more time: You didn't understand it correctly. OP has meant: "I
don't want to touch the object on which points Array.prototype as I
don't wanna break down [for-in] loops for ordinary arrays. But I don't
care what will be in [for-in] loops with own extended object". Is it
so hard to understand? ;)
From: Thomas 'PointedEars' Lahn on
Dmitry A. Soshnikov wrote:

> Thomas 'PointedEars' Lahn wrote:
>> kangax wrote:
>> > Should I quote specific lines every time? Are you not able to
>> > understand the issue as a whole? Everyone seemed to have understood OP
>> > identically (more or less), except you.
>>
>> They did not. In any case:
>>
>> The fact that an opinion has been widely held is no evidence whatever
>> that it is not utterly absurd; indeed in view of the silliness of the
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>> majority of mankind, a widespread belief is more likely to be foolish
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>> than sensible.
^^^^^^^^^^^^^^
>> -- Bertrand Russell (1872-1970 CE)
>
> [...]
>> [...]
>> In any case, both approaches fail to address the requirement of "not
>> touch[ing] the .prototype of an Array". The resulting Array instance
>> will inherit enumerable properties that show up in for-in iteration.
>
> You still continue to sing your song, just because you can't say
> (yeah, I understand - it's hard, when you believe yourself higher than
> other ;)) - "sorry, guys, I did't understand it correctly", you still
> continue talking about stupid "the .prototype of an Array" ===
> "[[Prototype]] of []" [...]

q.e.d.


PointedEars
--
var bugRiddenCrashPronePieceOfJunk = (
navigator.userAgent.indexOf('MSIE 5') != -1
&& navigator.userAgent.indexOf('Mac') != -1
) // Plone, register_function.js:16
From: Dmitry A. Soshnikov on
On Oct 29, 2:27 pm, Thomas 'PointedEars' Lahn <PointedE...(a)web.de>
wrote:
> Dmitry A. Soshnikov wrote:
> > Thomas 'PointedEars' Lahn wrote:
> >> kangax wrote:
> >> > Should I quote specific lines every time? Are you not able to
> >> > understand the issue as a whole? Everyone seemed to have understood OP
> >> > identically (more or less), except you.
>
> >> They did not.  In any case:
>
> >> The fact that an opinion has been widely held is no evidence whatever
> >> that it is not utterly absurd; indeed in view of the silliness of the
>
>                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^>> majority of mankind, a widespread belief is more likely to be foolish
>
>    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
> >> than sensible.
>    ^^^^^^^^^^^^^^
> >> -- Bertrand Russell (1872-1970 CE)
>
> > [...]
> >> [...]
> >> In any case, both approaches fail to address the requirement of "not
> >> touch[ing] the .prototype of an Array".  The resulting Array instance
> >> will inherit enumerable properties that show up in for-in iteration.
>
> > You still continue to sing your song, just because you can't say
> > (yeah, I understand - it's hard, when you believe yourself higher than
> > other ;)) - "sorry, guys, I did't understand it correctly", you still
> > continue talking about stupid "the .prototype of an Array" ===
> > "[[Prototype]] of []" [...]
>
> q.e.d.
>
> PointedEars
> --
> var bugRiddenCrashPronePieceOfJunk = (
>     navigator.userAgent.indexOf('MSIE 5') != -1
>     && navigator.userAgent.indexOf('Mac') != -1
> )  // Plone, register_function.js:16

:D don't be worry, you already lost ;)

Again advise to you (you should sure ignore it ;)) - try to discuss
with more scientific approach and without thinking that you're higher
than other (if you want the objective meaning - you're now just a bit
deeper in ES than casual programmer, so don't lie to yourself when
talking with other from the top ;)).

And yep - the talk is over with you.
From: wilq on
Thanks all of you of interesting answers. It seems that this is
impossible to do in all browsers. I really like a Kangax solution. But
unfortunatelly it does not work on IE :( (because of __proto__)
Hopefully future JavaScript solutions will allow this kind of problem
to be solved. Cheers,

wilq32
From: VK on
wilq wrote:
> Thanks all of you of interesting answers. It seems that this is
> impossible to do in all browsers.

??... as you wish of course...

Out of curiosity, what is exactly dysfunctional and on what platform
in the posted solution?

http://groups.google.com/group/comp.lang.javascript/msg/13d8201987b9d24e