B.3.1 The __proto__ pseudo property

Mark Miller erights at gmail.com
Sun Apr 21 21:48:31 PDT 2013

On Sun, Apr 21, 2013 at 9:42 PM, Brendan Eich <brendan at mozilla.com> wrote:

> Ok, so (after pushing back based on recorded consensus, which I think is
> fair), I'm ok with
> * Object.prototype.__proto__ is configurable.
> * o = {__proto__: p} semantics changes from ES5's [[Put]] to ES6's
> [[SetInheritance]].
> I'm not sure everyone agrees, but let's assume these two.
> Why, given these, must Object.prototype.__proto__ not reflect at all via
> Object.**getOwnPropertyDescriptor?

What? Where is that proposed? (And again, I am jumping into this thread in
the middle, so apologies for lack of context.)

> What about Object.getOwnPropertyNames? We have to sink some cost
> somewhere, and TC39 had a January near-consensus of "accessor, with get and
> set functions that throw on cross-realm |this| vs. the accessor function".
> That seems the best solution to me still, and it should fall out of
> cross-window/frame wrapper policy hooks fairly cheaply in SpiderMonkey.

That sounds good to me too. Where is the alternative explained?

> Re: Mark's
>   3) If we extend object literals with the computed name expression
> square-bracket syntax, consider
>>      { [ e ]: .... }
>>  where e is an expression that evaluates to the string "__proto__".
> This *must not* fall into the equivalent of the syntactic special case. To
> do so is to move the encoding error of #2 from code-generating programs to
> regular JS reflective programs.
> I agree with Mark. This does indeed mean that
>   n = "__proto__";
>   o = { [n]: p }
> will define a data property, not set inheritance. That's the only way
> quoting can matter, i.e.
>   o = { ['__proto__']: p }
> defines a plain old data property. No need to mimic JSON and make a quoted
> vs. unquoted difference without the [] for computed property names. Making
> that change requires a search of the web to find disproof, which is never a
> complete search, which leaves us hanging and makes implementors unhappy to
> take unknown risk.
> /be
> ______________________________**_________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/**listinfo/es-discuss<https://mail.mozilla.org/listinfo/es-discuss>

Text by me above is hereby placed in the public domain

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130421/d540be43/attachment-0001.html>

More information about the es-discuss mailing list