improve keep_fargs & keep_fnames

- utilise in_use_ids instead of unreferenced()
- drop_unused now up-to-date for subsequent passes

closes #1476
This commit is contained in:
alexlamsl
2017-02-18 19:19:12 +08:00
parent c525a2b190
commit b8b133d91a
2 changed files with 42 additions and 12 deletions

View File

@@ -556,3 +556,37 @@ drop_toplevel_keep_assign: {
console.log(b = 3);
}
}
drop_fargs: {
options = {
keep_fargs: false,
unused: true,
}
input: {
function f(a) {
var b = a;
}
}
expect: {
function f() {}
}
}
drop_fnames: {
options = {
keep_fnames: false,
unused: true,
}
input: {
function f() {
return function g() {
var a = g;
};
}
}
expect: {
function f() {
return function() {};
}
}
}