On Apr 21, 2013, at 3:11 PM, Mark S. Miller wrote: > On Sun, Apr 21, 2013 at 1:37 PM, Brendan Eich <bren...@mozilla.com> wrote: > Allen Wirfs-Brock wrote: > On Apr 21, 2013, at 12:31 PM, Brendan Eich wrote: > > You don't want that to affect object literals evaluated in the same realm > > after such a deletion. Why not? > > Why should it? > > ... because it did in ES5-conforming implementations that support __proto__ > as a de-facto standard *and* allow delete Object.prototype.__proto__. > > > We already used the existence of {__proto__: whatever} got rid of<| as > declarative syntax for defining an object literal with a [[Prototype]] other > than object prototype. Making {__proto__: whatever} only work some of the > times means it isn't a reliable declarative syntax. > > What? > > Mark insists on delete Object.prototype.__proto__ making the magic go away. > (Summoning Mark.) > > ;) > > I agree with the spirit of what Allen is saying, but I'm not sure if I agree > on the particulars. {__proto__: whatever, ....} is special syntax sets the > [[Prototype]] property of the resulting object to the value of whatever. This > syntax does not invoke [[Put]] anything and has no relationship (beyond > evocative similarity) to the property Object.prototype.__proto__, whether it > has been deleted or not. This special status does not apply to obj.__proto__ > = whatever, nor to object.__proto__. Those two do a simple [[Set]] (or, in > ES5 terms, [[Put]]) and [[Get]] respectively, and so do depend on the > existence and nature of an inherited __proto__ property.
Mark, as far as I could tell you are agreeing with the particulars I specified for {__proto__: whatever, ...}. Please check the spec. strawman I posted. Where we disagree is may be WRT whether it is reasonable for Dunder proto be a regular accessor property. Note that other characteristics of it that have been proposed (delete behavior, "not reflected", get function that throws when directly invoked, etc.) seems to require the use of an exotic object for Object.prototype. Once you go that far, we might as well define Dunder prototype behavior as part of the exotic [[Get]] and [[Set]] behavior of that object. Allen
_______________________________________________ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss