fix corner case in collapse_vars (#4013)

fixes #4012
This commit is contained in:
Alex Lam S.L
2020-07-20 16:28:13 +01:00
committed by GitHub
parent 2021c2fa3e
commit a5db8cd14c
2 changed files with 40 additions and 1 deletions

View File

@@ -8280,3 +8280,40 @@ issue_3976: {
}
expect_stdout: "PASS"
}
issue_4012: {
options = {
collapse_vars: true,
dead_code: true,
evaluate: true,
}
input: {
(function(a) {
try {
throw 2;
} catch (b) {
a = "PASS";
if (--b)
return;
if (3);
} finally {
console.log(a);
}
})();
}
expect: {
(function(a) {
try {
throw 2;
} catch (b) {
a = "PASS";
if (--b)
return;
if (3);
} finally {
console.log(a);
}
})();
}
expect_stdout: "PASS"
}