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
Binary operator after TypeScript as
assertion causes wrong SyntaxError
#11446
Comments
Hey @woongsikchoi! 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." |
@DanielRosenwasser What is the precedence of the Specifically, on the right (EDIT: I initially wrote left here) is it higher or lower than relational operators? I'm asking because from my experiments it has an higher precedence than a as b > c > +d; // This is parsed as two `>` operators, and an unary `+`
a as b < c > +d; // This is parsed as a sum between (a as b<c>) and d Also, is it correct that on the left it is between relational operators and equality operators? |
The same problem occurs also for the nullish coalescing operator |
Also dealing with this bug. |
Never mind I have fixed both of them. |
Bug Report
Current Behavior
If a bianry operator like
>=
appears directly after TypeScriptas
assertion, a wrong SyntaxError occurs.Input Code
The above code causes the following SyntaxError:
Expected behavior/code
No SyntaxError should occur.
Babel Configuration (babel.config.js, .babelrc, package.json#babel, cli command, .eslintrc)
.babelrc
Environment
The text was updated successfully, but these errors were encountered: