simple shorter function syntax
Maciej Stachowiak
mjs at apple.com
Mon Jul 26 04:44:48 PDT 2010
On Jul 26, 2010, at 3:56 AM, Cameron McCormack wrote:
> Cameron McCormack:
>>> mapPairs(someObject, { (a, b) => a + '=' + b) });
>
> Maciej Stachowiak:
>> If you allow multiple arguments with this syntax, either with or
>> without parens, you're back to unbounded lookahead required for an LL
>> parser.
>
> Shouldn’t be. Take the parens required option. After parsing the open
> brace, there are only two options: either you get an identifier or
> string literal, in which case the open brace started an object literal,
> or you get an open parenthesis, in which case it’s a function.
I see. I was thinking of ambiguity with a block, but those generally can't appear in the same context as expressions.
Regards,
Maciej
More information about the es-discuss
mailing list