@@ -244,7 +244,11 @@ merge(Compressor.prototype, {
|
||||
}
|
||||
if (node instanceof AST_ForIn) {
|
||||
if (node.init instanceof AST_SymbolRef) {
|
||||
node.init.definition().fixed = false;
|
||||
var d = node.init.definition();
|
||||
d.references.push(node.init);
|
||||
d.fixed = false;
|
||||
} else {
|
||||
node.init.walk(tw);
|
||||
}
|
||||
node.object.walk(tw);
|
||||
push();
|
||||
|
||||
@@ -589,3 +589,39 @@ inner_var_for_in: {
|
||||
x(1, b, c, d);
|
||||
}
|
||||
}
|
||||
|
||||
issue_1533_1: {
|
||||
options = {
|
||||
collapse_vars: true,
|
||||
reduce_vars: true,
|
||||
}
|
||||
input: {
|
||||
var id = "";
|
||||
for (id in {break: "me"})
|
||||
console.log(id);
|
||||
}
|
||||
expect: {
|
||||
var id = "";
|
||||
for (id in {break: "me"})
|
||||
console.log(id);
|
||||
}
|
||||
}
|
||||
|
||||
issue_1533_2: {
|
||||
options = {
|
||||
evaluate: true,
|
||||
reduce_vars: true,
|
||||
}
|
||||
input: {
|
||||
var id = "";
|
||||
for (var id in {break: "me"})
|
||||
console.log(id);
|
||||
console.log(id);
|
||||
}
|
||||
expect: {
|
||||
var id = "";
|
||||
for (var id in {break: "me"})
|
||||
console.log(id);
|
||||
console.log(id);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user