Jasper St. Pierre wrote:
Unless

    x => {foo: bar}

and

    x => {}

both parse as object literals, I'm against your proposal. Either un-paren'd braces are consistently a block, or they're consistently an object literal. Python has had major pains with "i before e except after c" rules to make the language nicer to use, and it's easier to tell people "always add the parens".

Fair.

A third option is to make x => {foo: bar} a syntax error to steer people away from an accidental footgun, while still making {} a block, and keeping the consistency of "parens around object literals".

Just about too late for ES6, though. Eep!

/be
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to