Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VariableDeclarator + ArrowFunctionExpression with named parameter throw 'Unexpected token =>' #1014

Closed
mikesherov opened this issue Feb 9, 2015 · 3 comments

Comments

@mikesherov
Copy link
Member

From @termi in https://code.google.com/p/esprima/issues/detail?id=483

What steps will reproduce the problem?
Parse 'let test1 = ({a}) => ([a])' using esprima#harmony

What is the expected output?
AST

What do you see instead?
Error: Line 1: Unexpected token =>

Suggested Fix:
https://github.com/termi/es6-transpiler/blob/e99435f45aad8cac89c04208d1c33b4a7a57422f/lib/esprima_harmony.js#L3130#L3131

@fkling
Copy link

fkling commented Feb 9, 2015

A fix for that is already in the harmony branch: 0e4014d

@mikesherov
Copy link
Member Author

Thanks @fkling!

@ikarienator
Copy link
Contributor

I recently found out that all the cases can be handled together directly in parseGroupExpression. We will have a much elegant way of dealing with ArrowFunctionExpressions soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants