A random collection of ES4 draft spec surprises and thoughts

Jeff Dyer jodyer at adobe.com
Mon May 26 14:04:50 PDT 2008

On 5/26/08 11:06 AM, Mark S. Miller wrote:

> * What's "__proto__" doing in the grammar? If we want to provide
> access to the internal [[Prototype]] property (as I think we do), we
> should do that explicitly with a reflective operation such as
> Object.prototypeOf(obj). But please let's avoid turning this internal
> property into a named property. Doing so breaks the subset
> relationship between JSON and EcmaScript. (Granted, we also need to
> acknowledge that this relationship is currently broken by Firefox. But
> part of the purpose of standards is to encourage browser vendors to
> repair their implementations.)

You'll notice that it is used as a keyword in object literals to allow
setting up the [[Prototype]] of an object, and as an attribute to mean what
'prototype' used to mean. We felt 'prototype' was already used too broadly
to reserve for this specific purpose.

> * What's ">=="? I've never seen that before.

Residue of an erased construct.

> * What does the "var" attribute mean inside an object literal?
> * Now that we have let-at-the-new-var, i.e., a properly lexically
> scoped letrec behavior, do we still need the "let" expression and the
> "let" comprehension? Can we kill these?
> * Why does the grammar allow function calls in
> LeftHandSideExpressions. For example, what's the meaning of
>     foo(a)++
> ?
> * Why does delete operate on a PostFixExpression rather than a
> LeftHandSideExpression? What's the meaning of
>     delete x++;
> ?

Its a bug, but not the one you are reporting. For compatibility with ES3 the
operand of the 'delete' operator must be a /UnaryExpression/. This allows
non-sense expressions like 'delete void 0'. The result, in case you are
wondering, is /true/.


More information about the Es4-discuss mailing list