fix dead_code on exceptional return (#2930)

fixes #2929
This commit is contained in:
Alex Lam S.L
2018-02-18 04:36:00 +08:00
committed by GitHub
parent 4a528c469c
commit 2351a672ea
2 changed files with 36 additions and 5 deletions

View File

@@ -917,3 +917,28 @@ issue_2860_2: {
}
expect_stdout: "1"
}
issue_2929: {
options = {
dead_code: true,
}
input: {
console.log(function(a) {
try {
return null.p = a = 1;
} catch (e) {
return a ? "PASS" : "FAIL";
}
}());
}
expect: {
console.log(function(a) {
try {
return null.p = a = 1;
} catch (e) {
return a ? "PASS" : "FAIL";
}
}());
}
expect_stdout: "PASS"
}