fix dead_code on nested try (#2599)

fixes #2597
This commit is contained in:
Alex Lam S.L
2017-12-15 19:41:28 +08:00
committed by GitHub
parent 092d9affb8
commit 7d6907cb99
2 changed files with 45 additions and 7 deletions

View File

@@ -789,3 +789,42 @@ throw_assignment: {
"caught -9",
]
}
issue_2597: {
options = {
dead_code: true,
}
input: {
function f(b) {
try {
try {
throw "foo";
} catch (e) {
return b = true;
}
} finally {
b && (a = "PASS");
}
}
var a = "FAIL";
f();
console.log(a);
}
expect: {
function f(b) {
try {
try {
throw "foo";
} catch (e) {
return b = true;
}
} finally {
b && (a = "PASS");
}
}
var a = "FAIL";
f();
console.log(a);
}
expect_stdout: "PASS"
}