preserve side effects in switch expression (#1694)

fixes #1690
This commit is contained in:
Alex Lam S.L
2017-03-27 02:32:46 +08:00
committed by GitHub
parent f001e4cb9d
commit f5952933a0
2 changed files with 34 additions and 7 deletions

View File

@@ -553,3 +553,29 @@ issue_1680_2: {
}
expect_stdout: true
}
issue_1690_1: {
options = {
dead_code: true,
}
input: {
switch (console.log("PASS")) {}
}
expect: {
console.log("PASS");
}
expect_stdout: "PASS"
}
issue_1690_2: {
options = {
dead_code: false,
}
input: {
switch (console.log("PASS")) {}
}
expect: {
switch (console.log("PASS")) {}
}
expect_stdout: "PASS"
}