-
-
Notifications
You must be signed in to change notification settings - Fork 413
Closed
Labels
Description
Bug report or Feature request?
Bug report
Version (complete output of terser -V
or specific git commit)
terser 5.30.1
Complete CLI command or minify()
options used
terser test.js --compress --output test.min.js
terser
input
class X {
#y;
z() {
if(!(#y in this)) {
return 0;
}
}
}
terser
output or error
class X{#y;z(){if(!#y in this)return 0}}
Running the code throw this exception
class X{#y;z(){if(!#y in this)return 0}}
^^
SyntaxError: Unexpected identifier '#y'
at ModuleLoader.moduleStrategy (node:internal/modules/esm/translators:167:18)
at callTranslator (node:internal/modules/esm/loader:285:14)
at ModuleLoader.moduleProvider (node:internal/modules/esm/loader:291:30)
at async link (node:internal/modules/esm/module_job:76:21)
Node.js v20.11.1
Expected result
class X{#y;z(){if(!(#y in this))return 0}}
Keeping the parentheses around #y in this
solve this problem