fix corner case in collapse_vars (#4199)

fixes #4197
This commit is contained in:
Alex Lam S.L
2020-10-12 07:13:17 +01:00
committed by GitHub
parent 9b7a13c8c7
commit b512726cf3
3 changed files with 36 additions and 3 deletions

View File

@@ -776,3 +776,32 @@ issue_4195: {
}
expect_stdout: "undefined"
}
issue_4197: {
options = {
collapse_vars: true,
}
input: {
var a = 0;
try {
const b = function() {
a = 1;
b[1];
}();
} catch (e) {
console.log(a);
}
}
expect: {
var a = 0;
try {
const b = function() {
a = 1;
b[1];
}();
} catch (e) {
console.log(a);
}
}
expect_stdout: "1"
}