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
$ cat sample.unused-true.min.js
(function() {
switch (value) {
case"x":
const value = "dummy";
console.log("value is x.");break;
default:
console.log(`value is not x.`);
}
})();
$ node sample.unused-true.min.js
/home/jharai/Sandbox/minifyjs/sample.unused-true.min.js:2
switch (value) {
^
ReferenceError: value is not defined
at /home/jharai/Sandbox/minifyjs/sample.unused-true.min.js:2:13
at Object.<anonymous> (/home/jharai/Sandbox/minifyjs/sample.unused-true.min.js:11:3)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
at internal/main/run_main_module.js:17:47
The text was updated successfully, but these errors were encountered:
Declaring the same variable name inside
switch
causes the outer one to drop when uglified withunused=true
option.Uglify version (
uglifyjs -V
)JavaScript input
The
uglifyjs
CLI command executed orminify()
options used.Disable most of features and set
unused=true
:JavaScript output or error produced.
The text was updated successfully, but these errors were encountered: