(x) => {foo: bar}

Brendan Eich brendan at mozilla.org
Mon Jan 5 12:06:26 PST 2015


Kevin Smith wrote:
>
>     I think hacking around this would not get rid of the footgun, but
>     would just make it more complicated to understand the footgun,
>     personally.
>
>
> My gut reaction is to agree - the current rule, while it takes some 
> trivial learning, is easy to understand and communicate and is 
> reflected well in other parts of the language.  Also, additions to 
> object literal syntax might make this more...weird:
>
>    x => { [abc](def = function() { huh() }) { blahblahblah } };
>
> "But it's an object literal, obviously!"

Yes, there's always a trade-off, some futures are foreclosed by syntax 
changes of this sort.

Is it worth it? Hard to say, crystal ball service not answering the 
phone ;-). Still, the motivation for that strawman I wrote in 2011 lives on.

/be


More information about the es-discuss mailing list