fix corner case in dead_code (#3553)

fixes #3552
This commit is contained in:
Alex Lam S.L
2019-10-30 14:21:22 +08:00
committed by GitHub
parent f1eb03f2c0
commit ec7f071272
2 changed files with 33 additions and 9 deletions

View File

@@ -1042,3 +1042,25 @@ function_assign: {
}
expect_stdout: "PASS"
}
issue_3552: {
options = {
dead_code: true,
pure_getters: "strict",
}
input: {
var a = "PASS";
(function() {
(1..p += 42) && (a = "FAIL");
})();
console.log(a);
}
expect: {
var a = "PASS";
(function() {
(1..p += 42) && (a = "FAIL");
})();
console.log(a);
}
expect_stdout: "PASS"
}