fix corner case in collapse_vars (#3701)

fixes #3700
This commit is contained in:
Alex Lam S.L
2020-01-30 09:04:44 +08:00
committed by GitHub
parent a3754068dd
commit 79c60032a5
2 changed files with 32 additions and 1 deletions

View File

@@ -7734,3 +7734,34 @@ issue_3698_3: {
}
expect_stdout: "2"
}
issue_3700: {
options = {
collapse_vars: true,
}
input: {
var a = "FAIL";
try {
a = "PASS";
(function() {
throw 0;
})();
a = 1 + a;
} catch (e) {
}
console.log(a);
}
expect: {
var a = "FAIL";
try {
a = "PASS";
(function() {
throw 0;
})();
a = 1 + a;
} catch (e) {
}
console.log(a);
}
expect_stdout: "PASS"
}