statements that could be expressions?

Waldemar Horwat waldemar at
Fri Jun 3 15:11:58 PDT 2011

On 06/02/11 20:12, Brendan Eich wrote:
>> - Conflict between blocks and statements:
>> a = {x: while (x) { ... break x;}}
>> is either an object initializer or a block containing a labeled while statement.
> based on feedback from Jorge here on the list mentions a block that cannot start with a label. Two-token lookahead restriction, why not?

Don't you also want to allow (either now or in the future) for the shorthand {x, y} to mean {x:x, y:y}?  There are also getters, setters, and various other stuff that can be put into object initializers now or in the future, so there are more possibilities than just an identifier followed by a colon.


More information about the es-discuss mailing list