@@ -4800,7 +4800,7 @@ merge(Compressor.prototype, {
|
||||
return true;
|
||||
}
|
||||
if (node instanceof AST_ForIn) {
|
||||
if (!compressor.option("loops")) return;
|
||||
if (!drop_vars || !compressor.option("loops")) return;
|
||||
if (!is_empty(node.body)) return;
|
||||
if (node.init.has_side_effects(compressor)) return;
|
||||
node.object.walk(tw);
|
||||
|
||||
@@ -985,3 +985,27 @@ issue_4075: {
|
||||
}
|
||||
expect_stdout: "PASS"
|
||||
}
|
||||
|
||||
issue_4082: {
|
||||
options = {
|
||||
keep_fargs: "strict",
|
||||
loops: true,
|
||||
unused: true,
|
||||
}
|
||||
input: {
|
||||
var a = "PASS";
|
||||
(function(a) {
|
||||
for (a in "foo")
|
||||
var b;
|
||||
})();
|
||||
console.log(a);
|
||||
}
|
||||
expect: {
|
||||
var a = "PASS";
|
||||
(function(a) {
|
||||
for (a in "foo");
|
||||
})();
|
||||
console.log(a);
|
||||
}
|
||||
expect_stdout: "PASS"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user