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
The statements inside this if block are unreachable:
if (false) {
console.log('unreachable');
switch (1) {
case 1: console.log('1'); break;
case 2: console.log('2'); break;
}
}
However it is minified to a useless skeleton still containing the original case statements (Repro on 0.20.1):
if(0)switch(1){case 1:case 2:}
This is particularly problematic if the switch is contained in a function, since I want the function call to be stripped out.
const enabled = false;
function funcWithSwitch() {
if (enabled) {
switch (1) {
case 1: console.log('1'); break;
case 2: console.log('1'); break;
}
}
}
funcWithSwitch(); // not stripped out, due entirely to the switch statement