@@ -279,11 +279,11 @@ merge(Compressor.prototype, {
|
||||
var reduce_vars = rescan && compressor.option("reduce_vars");
|
||||
var safe_ids = Object.create(null);
|
||||
var suppressor = new TreeWalker(function(node) {
|
||||
if (node instanceof AST_Symbol) {
|
||||
if (!(node instanceof AST_Symbol)) return;
|
||||
var d = node.definition();
|
||||
if (!d) return;
|
||||
if (node instanceof AST_SymbolRef) d.references.push(node);
|
||||
d.fixed = false;
|
||||
}
|
||||
});
|
||||
var tw = new TreeWalker(function(node, descend) {
|
||||
node._squeezed = false;
|
||||
|
||||
@@ -2575,3 +2575,28 @@ accessor: {
|
||||
}
|
||||
expect_stdout: "1 1"
|
||||
}
|
||||
|
||||
for_in_prop: {
|
||||
options = {
|
||||
reduce_vars: true,
|
||||
}
|
||||
input: {
|
||||
var a = {
|
||||
foo: function() {
|
||||
for (this.b in [1, 2]);
|
||||
}
|
||||
};
|
||||
a.foo();
|
||||
console.log(a.b);
|
||||
}
|
||||
expect: {
|
||||
var a = {
|
||||
foo: function() {
|
||||
for (this.b in [1, 2]);
|
||||
}
|
||||
};
|
||||
a.foo();
|
||||
console.log(a.b);
|
||||
}
|
||||
expect_stdout: "1"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user