-
-
Notifications
You must be signed in to change notification settings - Fork 643
Closed
Labels
Milestone
Description
Input
if (false) {
for (var a; unknownGlobal && true; unknownGlobal && true) var b;
} else {
console.log(a, b);
}
if (((() => console.log('effect'))(), true)) {
} else {
var c = 1;
for (var c; unknownGlobal && true; unknownGlobal && true) var d;
}
console.log(c, d);
Output
console.log(a, b);
console.log(c, d);
Expected
var b, a; {
console.log(a, b);
}
var c, d; if (((() => console.log('effect'))(), true)) ;
console.log(c, d);
The a,b,c,d
need to hosted, the ((() => console.log('effect'))()
need to preserve.
Found the case at https://github.com/rollup/rollup/blob/master/test/form/samples/hoisted-vars-in-dead-branches/main.js