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

shouldn't allow trailing comma after rest parameter in objects #5092

Closed
gsathya opened this issue Jan 11, 2017 · 5 comments
Closed

shouldn't allow trailing comma after rest parameter in objects #5092

gsathya opened this issue Jan 11, 2017 · 5 comments
Labels
Has PR outdated A closed issue/PR that is archived due to age. Recommended to make a new issue pkg: parser PR: Breaking Change 💥 A type of pull request used for our changelog categories for next major release PR: Spec Compliance 👓 A type of pull request used for our changelog categories
Milestone

Comments

@gsathya
Copy link
Member

gsathya commented Jan 11, 2017

Input Code

var { ...y, } = { a: 1} 

Babel Configuration (.babelrc, package.json, cli command)

Presets - stage3

Expected Behavior

throws SyntaxError

Current Behavior

No error

Possible Solution

Check for trailing comma and record pattern error.

@babel-bot
Copy link
Collaborator

Hey @gsathya! We really appreciate you taking the time to report an issue. The collaborators
on this project attempt to help as many people as possible, but we're a limited number of volunteers,
so it's possible this won't be addressed swiftly.

If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack
community that typically always has someone willing to help. You can sign-up here
for an invite.

@xtuc
Copy link
Member

xtuc commented Jan 11, 2017

I was not able to reproduce this in the Babel's REPL (link).

Coud you please add more detail to the issue?

@gsathya
Copy link
Member Author

gsathya commented Jan 11, 2017

I was not able to reproduce this in the Babel's REPL (link).

Coud you please add more detail to the issue?

It's reproducible in your link. There should be a SyntaxError, but there is no error.

@hzoo
Copy link
Member

hzoo commented Jan 11, 2017

@gsathya yep I had made this change as a patch and it broke react-native so I reverted. It will be a breaking change so we will do it in Babel 7.

Btw in the future if its a syntax error you can report it to babylon instead (the parser) https://github.com/babel/babylon

More context

PR that did this earlier: babel/babylon#149 (comment)
release notes: https://github.com/babel/babylon/releases/tag/v6.11.3

react-native issue: facebook/react-native#10199
rollback release: https://github.com/babel/babylon/releases/tag/v6.11.4

@hzoo hzoo added pkg: parser PR: Spec Compliance 👓 A type of pull request used for our changelog categories PR: Breaking Change 💥 A type of pull request used for our changelog categories for next major release labels Jan 11, 2017
@hzoo hzoo added this to the Babel 7 milestone Jan 14, 2017
@danez
Copy link
Member

danez commented Jan 16, 2017

This is done in babel/babylon#290

@danez danez closed this as completed Jan 16, 2017
@lock lock bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label May 5, 2018
@lock lock bot locked as resolved and limited conversation to collaborators May 5, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Has PR outdated A closed issue/PR that is archived due to age. Recommended to make a new issue pkg: parser PR: Breaking Change 💥 A type of pull request used for our changelog categories for next major release PR: Spec Compliance 👓 A type of pull request used for our changelog categories
Projects
None yet
Development

No branches or pull requests

6 participants