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
[flow] Fix parsing of arrows in conditional expressions in parentheses #13655
[flow] Fix parsing of arrows in conditional expressions in parentheses #13655
Conversation
@@ -1,3 +1,3 @@ | |||
{ | |||
"throws": "Unexpected token (1:13)" | |||
"throws": "Unexpected token (1:12)" |
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.
The input code is const f = (x?)
. The old error position was at )
; now it's at ?
.
@@ -1,3 +1,3 @@ | |||
{ | |||
"throws": "Unexpected token, expected \",\" (1:65)" | |||
"throws": "Unexpected token (1:65)" |
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.
The input code is a ? b : c ? d : e ? f : g ? h : i ? j : k ? l : m ? n : (o ? p : =);
. The old error message was wrong, since there is no way we could expect ,
instead of =
.
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/48015/ |
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 985dceb:
|
836215b
to
985dceb
Compare
* Add tests for babel/babel#13659 * Add tests for babel/babel#13655 * Add tests for babel/babel#13645 * Update tests
* Build(deps): Bump @babel/parser from 7.15.2 to 7.15.3 Bumps [@babel/parser](https://github.com/babel/babel/tree/HEAD/packages/babel-parser) from 7.15.2 to 7.15.3. - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v7.15.3/packages/babel-parser) --- updated-dependencies: - dependency-name: "@babel/parser" dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * Add tests for `@babel/parser` 7.15.3 (#11366) * Add tests for babel/babel#13659 * Add tests for babel/babel#13655 * Add tests for babel/babel#13645 * Update tests Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Sosuke Suzuki <aosukeke@gmail.com>
This was challenging, but the fixed code has less lines than the old code 😎