fix collapse_vars on nested exception (#2955)

fixes #2954
This commit is contained in:
Alex Lam S.L
2018-02-25 15:39:00 +08:00
committed by GitHub
parent 52de64cf16
commit ea2359381b
2 changed files with 40 additions and 4 deletions

View File

@@ -4665,3 +4665,38 @@ issue_2931: {
}
expect_stdout: "undefined"
}
issue_2954: {
options = {
collapse_vars: true,
}
input: {
var a = "PASS", b;
try {
do {
b = function() {
throw 0;
}();
a = "FAIL";
b && b.c;
} while (0);
} catch (e) {
}
console.log(a);
}
expect: {
var a = "PASS", b;
try {
do {
b = function() {
throw 0;
}();
a = "FAIL";
b && b.c;
} while (0);
} catch (e) {
}
console.log(a);
}
expect_stdout: "PASS"
}