fix corner case in collapse_vars & reduce_vars (#4748)

fixes #4747
This commit is contained in:
Alex Lam S.L
2021-03-07 02:33:51 +00:00
committed by GitHub
parent c7520b4b97
commit 397e48b97e
2 changed files with 42 additions and 7 deletions

View File

@@ -1379,3 +1379,32 @@ issue_4738_3: {
expect_stdout: "PASS"
node_version: ">=8"
}
issue_4747: {
options = {
collapse_vars: true,
reduce_vars: true,
unused: true,
}
input: {
console.log(function(a) {
async function f() {
a = "PASS";
null.p += "PASS";
}
f();
return a;
}("FAIL"));
}
expect: {
console.log(function(a) {
(async function() {
a = "PASS";
null.p += "PASS";
})();
return a;
}("FAIL"));
}
expect_stdout: "PASS"
node_version: ">=8"
}