fix corner case in functions (#4824)

fixes #4823
This commit is contained in:
Alex Lam S.L
2021-03-25 00:49:01 +00:00
committed by GitHub
parent 03c5ecb2e3
commit 39df3a1680
2 changed files with 31 additions and 0 deletions

View File

@@ -5991,3 +5991,33 @@ issue_4788: {
}
expect_stdout: "PASS"
}
issue_4823: {
options = {
functions: true,
reduce_vars: true,
unused: true,
}
input: {
console.log(typeof function() {
{
function f() {}
var arguments = f();
function g() {}
var arguments = g;
}
return f && arguments;
}());
}
expect: {
console.log(typeof function() {
{
function f() {}
arguments = f();
var arguments = function() {};
}
return f && arguments;
}());
}
expect_stdout: "function"
}