fix corner case in functions & unused (#3803)

fixes #3802
This commit is contained in:
Alex Lam S.L
2020-04-18 23:28:01 +01:00
committed by GitHub
parent eb6f32bfc3
commit e38754e802
2 changed files with 31 additions and 10 deletions

View File

@@ -2488,3 +2488,25 @@ drop_duplicated_var_catch: {
}
}
}
issue_3802: {
options = {
functions: true,
reduce_vars: true,
toplevel: true,
unused: true,
}
input: {
var a = 0;
a += 0;
var a = function() {};
console.log(typeof a);
}
expect: {
var a = 0;
a += 0;
a = function() {};
console.log(typeof a);
}
expect_stdout: "function"
}