On 2014/06/18 07:21:52, marja wrote:
Though, it was sort of expected that this is complicated, since we don't yet know whether we're in an arrow function or not when we see (foo, bar, ... :/

Unfortunately, you ain't seen nothing yet! ♫♪♫♪

Once we add support for destructuring (especially the CoverInitializedName) and
rest params, we have to parse the paren expression as a
CoverParenthesizedExpressionAndArrowParameterList, and then go back and reparse
and/or validate that.

For example:

var value = (a = 1, {x, y: z, w: {v}, [a, b, ...c], q);
var arrow = (a = 1, {x, y: z, w: {v}, [a, b, ...c], q) => { ... };

To support rest and CoverInitializedName we also need to support

var arrow = ({x = 1}, ...xs) => { ... };
var error = ({x = 1}, ...xs);  // SyntaxError: Unexpected token =

Anyway, I don't want to derail too much. I'm very excited that you are working on basic arrow function support even though I think the whole parsing part of it
will need to be reimplemented when we add support rest and destructuring.


https://codereview.chromium.org/160073006/

--
--
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