Proposal: Concise instance initialisation

Brendan Eich brendan at mozilla.com
Tue May 24 07:10:22 PDT 2011


On May 24, 2011, at 7:02 AM, Sean Eagan wrote:

>> This conflicts with the existing:
>> var foo = "bar";
>> {foo}  // "bar"
>> {!foo} // false
>> 
> 
> No, just because |{!b}| is current syntax, doesn't mean that |var a = {!b}| is.

I've been working on syntax lately, and based on that work, I think this goes too far. It requires splitting the grammar in a way that needs greater parsing power than LR(1), e.g. GLR. Unlikely to get by TC39 and implementors.

It would be better to preclude the ! and ~ prefixes from being used with the {b} shorthand.

/be



More information about the es-discuss mailing list