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

Mike Samuel mikesamuel at gmail.com
Fri Jul 1 10:51:41 PDT 2011


What is

   ({
     get
     x()
     {
       return 42;
     }
   })

?

Could it match both as an object literal with a getter

   ({ get x() { return 42; } })

or as a block with 3 statements?

   ({ get; x(); { return 42; } })


2011/7/1 Brendan Eich <brendan at mozilla.com>:
> On Jun 30, 2011, at 9:46 PM, Brendan Eich wrote:
>
>> Oops -- thanks. I will fix in a strawman that captures all of this.
>
> Done:
>
> http://wiki.ecmascript.org/doku.php?id=strawman:block_vs_object_literal
>
> /be
>
>


More information about the es-discuss mailing list