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
a better error message for disallowed trailing commas/additional parameters after rest elements in function params #9046
a better error message for disallowed trailing commas/additional parameters after rest elements in function params #9046
Conversation
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/9419/ |
) { | ||
this.raise( | ||
this.state.start, | ||
"Rest parameter must be last formal parameter", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your PR, It looks good to me.
At first the error mesage looked odd to me, but it's actually V8's one 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xtuc thanks! I'm glad that my first PR was not bad 😃 Yeah, I decided to get this message from V8.
Could you add a test for |
@nicolo-ribaudo yeah, sure |
Thank you! |
This PR changes error message when we had other parameters after rest element.
Previous behaviour:
Test:
Result
New behaviour:
Test:
Result: