New ES6 draft now available
allen at wirfs-brock.com
Sat Nov 24 09:36:55 PST 2012
On Nov 24, 2012, at 8:43 AM, David Bruant wrote:
> Le 24/11/2012 14:58, Axel Rauschmayer a écrit :
>>>> • MOP changes: Added [[GetInheritance]]/[[SetInheritance]] as internal methods for accessing [[Prototype]] internal prototype chain.
>>> Why not [[GetPrototype]] and [[SetPrototype]]? We have a absurd number of excellent resources (including but not limited to Dmitry Soshnikov and Axel Rauschmayer's websites/blogs) which use extensively the ES5 internal [[Prototype]]. It's also been very hard to get people to understand the difference between .prototype and [[Prototype]]. I'm afraid a new change would create a lot of confusion.
>> Currently, we have the following inheritance-related terms:
>> 1. [[Prototype]]
>> 2. [[GetInheritance]], [[SetInheritance]]
>> 3. __proto__
>> 4. Object.getPrototypeOf()
> The fact that Object.getPrototypeOf retrieves the [[Prototype]] (ES5) or delegates to [[GetPrototype]] (ES6?) makes sense. I find delegating to [[GetInheritance]] more debatable.
This is a point that TomV and I have debated. Tom also thinks that the MOP/Proxy trap/Reflect.* naming should follow the precedents set by ES<=5. My position is that these legacy functions are at a higher layer than the MOP and hence do not necessarily need to follow the same conventions. Also the current names are not all that consistent and don't reflect our current deeper understanding of JS objects (including DOM legacy). I'd prefer to keep the MOPish layer (including Proxy traps and Reflect.*) internally consistent and where necessary or beneficial deviate from legacy naming used at higher abstraction layers.
>> 5. C.prototype
>> 1-4 are closely related, 5 refers to a different concept. I still welcome any measure to make this terminology easier to understand and talk about, but I realize that that might not be possible.
> As far as ES6 is concerned, it's likely that the 5 form will disappear because classes will cover most of the basic needs. .prototype will become useful only for people who know what they're doing.
> But ES6 in production is far down the road...
Yes, but everything we are talking about here is specifically about ES6 and beyond...
More information about the es-discuss