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
Version (complete output of terser -V or specific git commit)
$ terser -Vterser 5.15.1
Complete CLI command or minify() options used
I turned off the unsafe option.
$ terser input.js -c unsafe=false
terser input
classx{static{varx=classextendsnew.target{};}}
terser output or error
classx{static{new.target}}
Expected result
Executing the output code, TypeError is expected since input code throws TypeError.
However, output code terminates without error.
$ node -e "class x { static { var x = class extends new . target { } ; } }" // input code throws a TypeError[eval]:1class x { static { var x = class extends new . target { } ; } } ^TypeError: Class extends value undefined is not a constructor or null at <static_initializer> ([eval]:1:28) at [eval]:1:1 at Script.runInThisContext (node:vm:129:12) at Object.runInThisContext (node:vm:313:38) at node:internal/process/execution:79:19 at [eval]-wrapper:6:22 at evalScript (node:internal/process/execution:78:60) at node:internal/main/eval_string:28:3Node.js v18.11.0
$ node -e "class x{static{new.target}}" // output code terminates without error
Activity