@@ -5860,7 +5860,15 @@ merge(Compressor.prototype, {
|
||||
if (def.scope === self) assignments.add(def.id, node);
|
||||
}
|
||||
var node_def, props = [], sym = assign_as_unused(node, props);
|
||||
if (sym && self.variables.get(sym.name) === (node_def = sym.definition())) {
|
||||
if (sym && self.variables.get(sym.name) === (node_def = sym.definition())
|
||||
&& !(is_arguments(node_def) && !all(self.argnames, function(argname) {
|
||||
return !argname.match_symbol(function(node) {
|
||||
if (node instanceof AST_SymbolFunarg) {
|
||||
var def = node.definition();
|
||||
return def.references.length > def.replaced;
|
||||
}
|
||||
}, true);
|
||||
}))) {
|
||||
props.forEach(function(prop) {
|
||||
prop.walk(tw);
|
||||
});
|
||||
|
||||
@@ -3112,3 +3112,25 @@ issue_4235: {
|
||||
}
|
||||
expect_stdout: "undefined"
|
||||
}
|
||||
|
||||
issue_4404: {
|
||||
options = {
|
||||
pure_getters: "strict",
|
||||
unused: true,
|
||||
}
|
||||
input: {
|
||||
function f(a) {
|
||||
arguments[0] = "PASS";
|
||||
console.log(a);
|
||||
}
|
||||
f("FAIL");
|
||||
}
|
||||
expect: {
|
||||
function f(a) {
|
||||
arguments[0] = "PASS";
|
||||
console.log(a);
|
||||
}
|
||||
f("FAIL");
|
||||
}
|
||||
expect_stdout: "PASS"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user