enhance unused (#3839)

This commit is contained in:
Alex Lam S.L
2020-05-03 10:38:28 +01:00
committed by GitHub
parent 20f9a1d908
commit 3766d5c962
2 changed files with 101 additions and 23 deletions

View File

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