@@ -1963,6 +1963,7 @@ merge(Compressor.prototype, {
|
||||
} else if (candidate instanceof AST_VarDef) {
|
||||
replaced = !compressor.exposed(def) && def.references.length == def.replaced;
|
||||
}
|
||||
value_def.last_ref = false;
|
||||
value_def.single_use = false;
|
||||
}
|
||||
if (replaced && !remove_candidate(candidate)) statements.splice(stat_index, 1);
|
||||
|
||||
@@ -9030,3 +9030,30 @@ issue_4868: {
|
||||
}
|
||||
expect_stdout: "PASS"
|
||||
}
|
||||
|
||||
issue_4874: {
|
||||
options = {
|
||||
collapse_vars: true,
|
||||
evaluate: true,
|
||||
reduce_vars: true,
|
||||
toplevel: true,
|
||||
unused: true,
|
||||
}
|
||||
input: {
|
||||
var a;
|
||||
a = null;
|
||||
(function(b) {
|
||||
for (var c in b = b && b[console.log("PASS")])
|
||||
console;
|
||||
})(a = 42);
|
||||
}
|
||||
expect: {
|
||||
var a;
|
||||
null;
|
||||
(function(b) {
|
||||
for (var c in a && a[console.log("PASS")])
|
||||
console;
|
||||
})(a = 42);
|
||||
}
|
||||
expect_stdout: "PASS"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user