fix corner case in reduce_vars (#4219)

fixes #4218
This commit is contained in:
Alex Lam S.L
2020-10-14 00:58:04 +01:00
committed by GitHub
parent 9f8106e1d8
commit 7f35d9cee0
2 changed files with 25 additions and 0 deletions

View File

@@ -931,6 +931,30 @@ issue_4207: {
expect_stdout: "0"
}
issue_4218: {
options = {
reduce_funcs: true,
reduce_vars: true,
toplevel: true,
unused: true,
}
input: {
{
const a = function() {};
var b = 0 * a;
}
console.log(typeof a, b);
}
expect: {
{
const a = function() {};
var b = 0 * a;
}
console.log(typeof a, b);
}
expect_stdout: true
}
issue_4210: {
options = {
reduce_vars: true,