You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
return -1 ** h;
^^^^^
SyntaxError: Unary operator used immediately before exponentiation expression. Parenthesis must be used to disambiguate operator precedence
swc_ecma_parser:
- Don't panic on `typeof import(T)`. (#2198)
- Fix parsing of ternary. (#2196)
swc_ecma_transforms_base:
- `fixer`: Handle unary in lhs of an exponentation expression. (#2191)
swc_ecma_transforms_compat:
- Use variable for `this` in arrow expressions. (#2212)
swc_ecma_visit:
- Add a trait `InjectVars`.
node_swc:
- Increease recursion limit while deserializing. (#2223)
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.
Describe the bug
If a unary operator is used as the first operand of an exponentiation, then that operand needs to be wrapped in parentheses.
Input code
Config
{ "env": {} }
and
"browserslist": "Chrome 90"
Expected behavior
swc output = input
Current behaviour
results in
Version
The version of @swc/core: 1.2.83
Additional context
Came up in parcel-bundler/parcel#6525
The text was updated successfully, but these errors were encountered: