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
Parse error at input.js:5,28
return num === 2 && #test in obj;
^
ERROR: Unexpected token: privatename (test)
at ...
Expected result
class Test{#t;test(t,s){return 2===t&&#t in s}}const t=new Test;console.log(t.test(2,{}));
Version 5.30.2 works and gives the expected output, 5.30.3 gives the error. The input is valid code, works in browsers and node.
Changing the offending line to
return(num===2)&&(#testinobj);
makes the error goes away, so maybe the problem is with operator precedence and 0e04a22 might be to blame? Both in and === have higher precedence than &&, so the two return statements should be entirely equivalent.
The text was updated successfully, but these errors were encountered:
Bug report
Version (complete output of
terser -V
or specific git commit)terser 5.30.3
Complete CLI command or
minify()
options usedterser input.js --compress --mangle
terser
inputterser
output or errorExpected result
class Test{#t;test(t,s){return 2===t&&#t in s}}const t=new Test;console.log(t.test(2,{}));
Version 5.30.2 works and gives the expected output, 5.30.3 gives the error. The input is valid code, works in browsers and node.
Changing the offending line to
makes the error goes away, so maybe the problem is with operator precedence and 0e04a22 might be to blame? Both
in
and===
have higher precedence than&&
, so the tworeturn
statements should be entirely equivalent.The text was updated successfully, but these errors were encountered: