fix corner case in merge_vars (#4151)
This commit is contained in:
@@ -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",
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user