Unifying Block and ObjectLiteral (was: Re: block-lambda revival)

Mike Samuel mikesamuel at gmail.com
Thu Jun 30 18:32:12 PDT 2011


2011/6/28 Brendan Eich <brendan at mozilla.com>:
> On Jun 23, 2011, at 3:27 PM, Brendan Eich wrote:
> Block:
>     { UnlabeledStatementFirstList }
>     { WellLabeledStatement StatementList? }

If IfStatement is still defined

IfStatement :
    if ( Expression ) Statement else Statement
    if ( Expression ) Statement

then does this definition of Statement and Block change the program

   if (foo) { bar(); } else {}

to be equivalent to

   if (foo) { bar(); } else ({})

?

This is arguably a semantic change, but the change cannot be
detectable by anything else the program could do.


More information about the es-discuss mailing list