fix reduce_vars within try-block (#1818)

Possible partial execution due to exceptions.
This commit is contained in:
Alex Lam S.L
2017-04-17 14:03:29 +08:00
committed by GitHub
parent 1a498db2d3
commit 71a8d0d236
2 changed files with 44 additions and 1 deletions

View File

@@ -2187,3 +2187,34 @@ issue_1814_2: {
}
expect_stdout: "0 '321'"
}
try_abort: {
options = {
evaluate: true,
reduce_vars: true,
unused: true,
}
input: {
!function() {
try {
var a = 1;
throw "";
var b = 2;
} catch (e) {
}
console.log(a, b);
}();
}
expect: {
!function() {
try {
var a = 1;
throw "";
var b = 2;
} catch (e) {
}
console.log(a, b);
}();
}
expect_stdout: "1 undefined"
}