fix corner case in functions (#4488)

fixes #4487
This commit is contained in:
Alex Lam S.L
2021-01-01 02:39:40 +00:00
committed by GitHub
parent a10c7793bb
commit 311c074622
2 changed files with 25 additions and 1 deletions

View File

@@ -134,3 +134,27 @@ issue_2295: {
}
}
}
issue_4487: {
options = {
functions: true,
hoist_vars: true,
keep_fnames: true,
reduce_vars: true,
toplevel: true,
unused: true,
}
input: {
var a = function f() {
var f = console.log(typeof f);
};
var b = a();
}
expect: {
function a() {
var a = console.log(typeof a);
}
a();
}
expect_stdout: "undefined"
}