fix corner case in dead_code (#3579)

fixes #3578
This commit is contained in:
Alex Lam S.L
2019-11-12 05:16:14 +08:00
committed by GitHub
parent 765a06340f
commit 5b20bad4b3
2 changed files with 33 additions and 4 deletions

View File

@@ -1102,3 +1102,30 @@ catch_return_assign: {
}
expect_stdout: "PASS"
}
issue_3578: {
options = {
dead_code: true,
}
input: {
var a = "FAIL", b, c;
try {
b = c.p = b = 0;
} catch (e) {
b += 42;
b && (a = "PASS");
}
console.log(a);
}
expect: {
var a = "FAIL", b, c;
try {
b = c.p = b = 0;
} catch (e) {
b += 42;
b && (a = "PASS");
}
console.log(a);
}
expect_stdout: "PASS"
}