fix corner case in merge_vars (#4151)

This commit is contained in:
Alex Lam S.L
2020-09-25 01:04:51 +01:00
committed by GitHub
parent 7de8daa4b1
commit af35cd32f2
2 changed files with 39 additions and 6 deletions

View File

@@ -2766,3 +2766,37 @@ issue_4139: {
}
expect_stdout: "object"
}
lambda_reuse: {
options = {
merge_vars: true,
toplevel: true,
}
input: {
var a, b, f = function() {
console.log(a);
};
f();
a = "PASS";
b = "FAIL";
f();
if (console.log(typeof b))
console.log(b);
}
expect: {
var a, b, f = function() {
console.log(a);
};
f();
a = "PASS";
b = "FAIL";
f();
if (console.log(typeof b))
console.log(b);
}
expect_stdout: [
"undefined",
"PASS",
"string",
]
}