-
-
Notifications
You must be signed in to change notification settings - Fork 420
Closed
Labels
Description
Bug report
Terser is using the same identifier for the function, and for the const defined inside the if. This produces code that can't be evaluated.
Here is a simple reproduction case:
function f1() {
if (true) {
function f2() {
return 1;
}
const var1 = 666;
}
}
If var1 is outside the "if", the correct identifier is used when minifying.
Used options:
{
module: true,
compress: {
unused: false
}
}
Curent terser output
function n(){{function n(){return 1}const n=666}}
note the inner function n() and the const n, they clash.
harryadel, DexterHaxxor and alanning