fix corner cases in collapse_vars (#4249)

fixes #4248
This commit is contained in:
Alex Lam S.L
2020-10-30 02:04:23 +00:00
committed by GitHub
parent 79e5c3f564
commit 5d12abc41b
4 changed files with 110 additions and 13 deletions

View File

@@ -8577,3 +8577,28 @@ issue_4242: {
}
expect_stdout: "undefined"
}
issue_4248: {
options = {
collapse_vars: true,
}
input: {
var a = 0;
try {
a = 1;
b[1];
} catch (e) {
console.log(a);
}
}
expect: {
var a = 0;
try {
a = 1;
b[1];
} catch (e) {
console.log(a);
}
}
expect_stdout: "1"
}