fix corner case in functions (#4619)

fixes #4618
This commit is contained in:
Alex Lam S.L
2021-02-07 05:52:09 +00:00
committed by GitHub
parent 5c84dfa151
commit 522cceeccf
2 changed files with 50 additions and 15 deletions

View File

@@ -1218,3 +1218,31 @@ issue_4598: {
expect_stdout: "PASS"
node_version: ">=8"
}
issue_4618: {
options = {
functions: true,
reduce_vars: true,
unused: true,
}
input: {
console.log(typeof function() {
var await = async function f() {
console || f();
};
console.log;
return await;
}());
}
expect: {
console.log(typeof function() {
var await = async function f() {
console || f();
};
console.log;
return await;
}());
}
expect_stdout: "function"
node_version: ">=8"
}