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
In JavaScript, it is impossible to write an ambiguous exponentiation expression, i.e. you cannot put a unary operator (+/-/~/!/delete/void/typeof) immediately before the base number.
I am using the following AST. I believe this is the correct AST to produce the desired outpput as acorn, cherow, and meriyah all produce the same output for this code. I was not able to test in esprima or espree as this code crashes them.
I believe I've found an error in how code is generated when a UnaryExpression is used as the base in an ExponentiationExpression:
From MDN:
I am using the following AST. I believe this is the correct AST to produce the desired outpput as
acorn
,cherow
, andmeriyah
all produce the same output for this code. I was not able to test inesprima
orespree
as this code crashes them.Expected behavior
Code should be generated with parentheses around the base when a unary operator is applied.
Actual behavior
No parentheses are added, leading to invalid code that throws an error when executed.
Error:
See also: jquery/esprima#1981
The text was updated successfully, but these errors were encountered: