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

Destructuring assignment to grouped spread arg should pass #872

Closed
pvdz opened this issue Sep 12, 2019 · 0 comments
Closed

Destructuring assignment to grouped spread arg should pass #872

pvdz opened this issue Sep 12, 2019 · 0 comments

Comments

@pvdz
Copy link

pvdz commented Sep 12, 2019

Input:

({...(obj)} = foo)

Expecting similar output as Babel (which will accept it). This is a destructuring assignment rest property which has looser syntax than with other patterns. The parenthesis are fine here because it's supposed to match a LeftHandSideExpression.

https://tc39.es/ecma262/#prod-AssignmentRestProperty
https://tc39.es/ecma262/#prod-DestructuringAssignmentTarget

https://astexplorer.net/#/gist/15eb31fbb1024faa6f42a4940d8beb4a/4aee1037f36aee9aaa0ffaac61e7ce4a3c1ba95e

(Unfortunately, Babel also accepts ({...(obj)}) => x, which is definitely illegal but regardless I'm confident it is legit in assignments)

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

Successfully merging a pull request may close this issue.

1 participant