B.3.1 The __proto__ pseudo property

Allen Wirfs-Brock allen at wirfs-brock.com
Sun Apr 21 12:28:00 PDT 2013


On Apr 21, 2013, at 12:05 PM, Brendan Eich wrote:

>>> 
>>> What I mean is that:
>>>     let obj = {__proto__: null}
>>> will always create an object whose [[Prototype]]
> 
> Didn't you mean "an object whose property named '__proto__'" here?
> 
>>> is null.  Regardless of whether or not anybody has done:
>>>    delete Object.prototype.__proto__.
>> 
>> Yes, that's what I just wrote!
>> 
>> What part was unclear?
> 
> Sorry, I misread your "[[Prototype]] is null" as "property named '__proto__' is null".
> 
> But you cannot break ES5. Why are you changing things to deviate from it, never mind from ES6 consensus?
> 

We must be talking across each other...web reality is that 
   var obj = {__proto__: someObj};

creates a new object whose [[Prototype]] is the value of someObj (assuming it is valid for that use).  Right?  Doesn't that mean that ES5 implementations that support that semantics already deviate from the ES5 spec which says that an own property named "__proto__" should be created via [[DefineOwnProperty]]?

Allen



More information about the es-discuss mailing list