fix corner case in switches (#4060)

fixes #4059
This commit is contained in:
Alex Lam S.L
2020-08-21 01:05:10 +01:00
committed by GitHub
parent a153176469
commit aa83ecdb3b
2 changed files with 34 additions and 2 deletions

View File

@@ -1150,3 +1150,34 @@ drop_switch_8: {
(C !== D ? y : z)();
}
}
issue_4059: {
options = {
conditionals: true,
dead_code: true,
evaluate: true,
switches: true,
}
input: {
switch (0) {
default:
case 1:
break;
case a:
break;
var a;
}
console.log("PASS");
}
expect: {
switch (0) {
default:
break;
case a:
break;
var a;
}
console.log("PASS");
}
expect_stdout: "PASS"
}