A random collection of ES4 draft spec surprises and thoughts

Mark S. Miller erights at google.com
Mon May 26 11:06:45 PDT 2008


In going over the ES4 draft spec docs, I found the following things surprising:

                      Grammar

* The BOM sequence shall be "replaced with a single white space
character". Which one? Should we say instead "treated as a single
whitespace character"?

* 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.)

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

* 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++;

?

* I thought "like" was dead. How did it get revived?

* What is

   "super" "(" Arguments ")"

? Last I heard, ES4 only has single implementation inheritance, so why
allow "super" to be qualified?


           Core Semantics

* I'm pleasantly surprised to see that the prototype reference (which
I take to be the same as the ES3 internal [[Prototype]] property) is
said to be immutable. Does this mean that we will be able to consider
the following behavior buggy (I hope so):

    var x = {};

    var y = {};

    x.__proto__ = y;
    [object Object]

    y.foo = 3;
    3

    x.foo
    3

* What namespace is "__ES4__" defined in? The text "The namespace
__ES4__is predefined. It is used to tag global names that have been
introduced in the 4th edition" would seem to indicate that __ES4__ is
itself defined in the namespace __ES4__. I'm probably missing or
confused about something.

* Unicode only has 21 bits of significance. That's enough headroom
that we should expect Unicode to live within these limits until the
United Federation of Planets makes peace with the Romulans and the
Klingons. So why is a string value defined as "a finite ordered
sequence of zero or more 32 bit unsigned integer values"?

* What does "Rib" mean? Is it an acronym?

* Is "A catch-all method operates on the object that contains the
method." a mistake? Did you mean "operates on the invoked object"?



-- 
    Cheers,
    --MarkM



More information about the Es4-discuss mailing list