fix corner case in unused (#4236)

fixes #4235
This commit is contained in:
Alex Lam S.L
2020-10-22 15:19:47 +01:00
committed by GitHub
parent 23ca7d675f
commit 9e40abeded
3 changed files with 50 additions and 3 deletions

View File

@@ -3085,3 +3085,30 @@ issue_4184: {
}
expect_stdout: "42"
}
issue_4235: {
options = {
inline: true,
reduce_vars: true,
unused: true,
varify: true,
}
input: {
(function() {
{
const f = 0;
}
(function f() {
var f = console.log(f);
})();
})();
}
expect: {
(function() {
f = console.log(f),
void 0;
var f;
})();
}
expect_stdout: "undefined"
}