fix corner case in functions (#5037)

fixes #5036
This commit is contained in:
Alex Lam S.L
2021-06-24 20:43:52 +01:00
committed by GitHub
parent 1a064b6e74
commit 7621527a5f
2 changed files with 28 additions and 5 deletions

View File

@@ -6258,3 +6258,28 @@ issue_5025: {
}
expect_stdout: "object"
}
issue_5036: {
options = {
functions: true,
reduce_vars: true,
unused: true,
}
input: {
console.log(typeof function() {
var await = function f() {
return f;
};
return await() === await;
}() ? "PASS" : "FAIL");
}
expect: {
console.log(typeof function() {
function await() {
return await;
}
return await() === await;
}() ? "PASS" : "FAIL");
}
expect_stdout: "PASS"
}