fix corner case in collapse_vars (#4970)

This commit is contained in:
Alex Lam S.L
2021-05-27 23:32:43 +01:00
committed by GitHub
parent ab42a90edb
commit 749a828fc5
2 changed files with 69 additions and 10 deletions

View File

@@ -1010,6 +1010,42 @@ collapse_vars_8: {
node_version: ">=6"
}
collapse_vars_9: {
options = {
collapse_vars: true,
}
input: {
console.log(function(a) {
try {
var b = function([ c ]) {
if (c)
return "FAIL 1";
}();
a = "FAIL 2";
return b;
} catch (e) {
return a;
}
}("PASS"));
}
expect: {
console.log(function(a) {
try {
var b = function([ c ]) {
if (c)
return "FAIL 1";
}();
a = "FAIL 2";
return b;
} catch (e) {
return a;
}
}("PASS"));
}
expect_stdout: "PASS"
node_version: ">=6"
}
conditionals: {
options = {
conditionals: true,