fix corner case in switches (#5011)

fixes #5010
This commit is contained in:
Alex Lam S.L
2021-06-15 13:59:53 +01:00
committed by GitHub
parent bf76e35772
commit 21fc8f4630
2 changed files with 27 additions and 1 deletions

View File

@@ -1556,3 +1556,29 @@ issue_5008_4: {
}
expect_stdout: "PASS"
}
issue_5010: {
options = {
dead_code: true,
evaluate: true,
switches: true,
}
input: {
var a;
switch (42) {
case console.log("PASS"):
case a:
console.log("FAIL");
case 42:
}
}
expect: {
var a;
switch (42) {
case console.log("PASS"):
case a:
console.log("FAIL");
}
}
expect_stdout: "PASS"
}