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

@@ -916,3 +916,37 @@ issue_4245: {
expect_stdout: ReferenceError("a is not defined")
node_version: ">=4"
}
issue_4248: {
options = {
collapse_vars: true,
}
input: {
var a = "FAIL";
try {
(function() {
"use strict";
a = "PASS";
b[a];
let b;
})();
} catch (e) {
console.log(a);
}
}
expect: {
var a = "FAIL";
try {
(function() {
"use strict";
a = "PASS";
b[a];
let b;
})();
} catch (e) {
console.log(a);
}
}
expect_stdout: "PASS"
node_version: ">=4"
}