News for hackers. Stuff that matters.
[deleted]
Re:How Javascript Prototypal Inheritance Really works by vjeux on Saturday May 28, 2011 @11:50AM (#2594612)
I just added a note saying that __proto__ is not standard and not supported on IE. Thanks for the comment :)
Re:How Javascript Prototypal Inheritance Really works by masklinn on Saturday May 28, 2011 @12:51PM (#2594732)
The note should be much bigger. And __proto__ really isn't "supported" anywhere: it's an implementation detail. It's been deprecated in Mozilla, and Opera used not to have it (as recently as 2009, though there is now an __proto__ property on all objects).

I would recommend a note similar to Dmitry Soshnikov's in his Javascript: The Core: http://dmitrysoshnikov.com/ecmascript/javascript-the-core/#a...

> Let’s take a basic figure of an object with which we will operate in the following descriptions. A prototype of an object is referenced by the internal [[Prototype]] property. However, in figures we will use __<internal-property>__ notation, and in particular for the prototype object: __proto__ (that’s moreover, is a real, but non-standard, implementation in some engines, e.g. SpiderMonkey).

It uses __proto__ but makes quite clear that the property is just an implementation detail of the graphs.

Re:How Javascript Prototypal Inheritance Really works by vjeux on Saturday May 28, 2011 @01:57PM (#2594854)
Thanks for the comment. I have added big red (orange...) box to make sure that no one uses __proto__ in real code :)
Re:How Javascript Prototypal Inheritance Really works by city41 on Saturday May 28, 2011 @12:06PM (#2594651)
gah, I saw that so I tried to quickly delete my comment :) Oh well. The deleted comment above just mentioned __proto__ is not standard.
Re:How Javascript Prototypal Inheritance Really works by simonsarris on Saturday May 28, 2011 @11:53AM (#2594619)
__proto__ is also deprecated and Object.getPrototypeOf should be used instead.
Re:How Javascript Prototypal Inheritance Really works by vjeux on Saturday May 28, 2011 @11:55AM (#2594624)
Unfortunately, getPrototypeOf is read only. It does not give an alternative to "new".