fix corner case in keep_fargs & reduce_vars (#4354)

fixes #4353
This commit is contained in:
Alex Lam S.L
2020-12-08 17:41:10 +00:00
committed by GitHub
parent fea9da9866
commit 046bbde9d4
2 changed files with 35 additions and 0 deletions

View File

@@ -1452,3 +1452,37 @@ issue_3619: {
}
expect_stdout: "PASS"
}
issue_4353_1: {
options = {
keep_fargs: "strict",
reduce_vars: true,
unused: true,
}
input: {
console.log(function f(a) {}.length);
}
expect: {
console.log(function(a) {}.length);
}
expect_stdout: "1"
}
issue_4353_2: {
options = {
keep_fargs: "strict",
reduce_vars: true,
unused: true,
}
input: {
(function f(a) {
while (console.log("PASS"));
})();
}
expect: {
(function() {
while (console.log("PASS"));
})();
}
expect_stdout: "PASS"
}