Updates:
        Cc: [email protected] [email protected] [email protected]

Comment #4 on issue 4211 by [email protected]: Wrong precedence for arrow function without parameters
https://code.google.com/p/v8/issues/detail?id=4211

Uf, it gets a bit worse.

d8> var x = (a)(b)=>bar
undefined
d8> x
(a)(b)=>bar
d8>

:( :( :(

The cause is that the current parse algorithm does a peek for (, then parses an assignment expression, then checks the classifier. The parsed assignment expression is (a)(b). To the classifier this is a valid arrow function formal parameter list. We don't see any other errors up to this point because it's only lazily parsed.

The solution I think is to move more logic into ParseAssignmentExpression, unfortunately. If we peek a ( then we will call ParseParenthesizedExpression, which will contain the guts of the LPAREN case of ParsePrimaryExpression. If an arrow follows the parenthesizedexpression, then we have an arrow function, whee. Otherwise we need to finish parsing the ConditionalExpression/LeftHandSideExpression, unfortunately, which means splitting off many continuations into helper functions: that of ConditionalExpression, BinaryExpression, PostfixExpression, LeftHandSideExpression, MemberExpression. Sadness.

Currently MemberExpression does have its continuation split off. Andreas would you mind verifying this diagnosis/plan? What a bummer!

--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to