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
Allow tuple rest trailing comma #10800
Allow tuple rest trailing comma #10800
Conversation
yeonjuan
commented
Dec 3, 2019
Q | A |
---|---|
Fixed Issues? | Fixes #10769 |
Patch: Bug Fix? | |
Major: Breaking Change? | |
Minor: New Feature? | |
Tests Added + Pass? | Yes |
Documentation PR Link | |
Any Dependency Changes? | |
License | MIT |
this.checkCommaAfterRest(charCodes.rightSquareBracket); | ||
if ( | ||
this.match(tt.comma) && | ||
this.lookaheadCharCode() !== charCodes.rightSquareBracket |
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.
Is there already a test for when ...a,
is not followed by ]
?
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.
babel/packages/babel-parser/test/fixtures/typescript/types/tuple-rest-invalid/input.ts
Line 1 in e74efd2
let x: [...number[], string] |
@nicolo-ribaudo yes! in the tuple-rest-invalid.
Thanks! |