B.3.1 The __proto__ pseudo property

Allen Wirfs-Brock allen at wirfs-brock.com
Sun Apr 21 11:41:21 PDT 2013


On Apr 21, 2013, at 11:12 AM, Brendan Eich wrote:

> David Herman wrote:
>> On Apr 21, 2013, at 8:55 AM, Allen Wirfs-Brock<allen at wirfs-brock.com>  wrote:
>> 
>>> Deleting Object.prototype.__proto__ will not be be specified as disabling {__proto__: foo}.
>> 
>> Was that what we'd agreed to?
> 
> I think what Allen means is, whether or not there's a magic Object.prototype.__proto__, you can define (as in [[DefineOwnProperty]]) a plain old data property (or an accessor, for that matter, just different syntax) whose name is '__proto__' in an object literal.

No, see the spec. strawman I posted.

What I mean is that:
    let obj = {__proto__: null}
will always create an object whose [[Prototype]] is null.  Regardless of whether or not anybody has done:
   delete Object.prototype.__proto__.

There is no good reason to link the semantics of __proto__ in an object literal to the existence of Dunder proto on Object.prototype.  The standard semantics of object literal properties in ES5 have no dependencies upon the shape of Object.prototype.

> 
> 
> This is specified by ES5, already.

Doesn't matter because what ES5 specifies is already incompatible with web reality when the property name is  __proto__.

Allen



More information about the es-discuss mailing list