@@ -9582,7 +9582,12 @@ merge(Compressor.prototype, {
|
|||||||
});
|
});
|
||||||
return node;
|
return node;
|
||||||
} else if (!node.has_side_effects(compressor)) {
|
} else if (!node.has_side_effects(compressor)) {
|
||||||
self.drop_side_effect_free = return_null;
|
self.drop_side_effect_free = function(compressor, first_in_statement) {
|
||||||
|
var self = this;
|
||||||
|
var exprs = self.args.slice();
|
||||||
|
exprs.unshift(self.expression);
|
||||||
|
return make_sequence(self, exprs).drop_side_effect_free(compressor, first_in_statement);
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var arg_used, insert, in_loop, scope;
|
var arg_used, insert, in_loop, scope;
|
||||||
|
|||||||
@@ -6629,3 +6629,29 @@ issue_5120: {
|
|||||||
}
|
}
|
||||||
expect_stdout: "PASS"
|
expect_stdout: "PASS"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
issue_5140: {
|
||||||
|
options = {
|
||||||
|
collapse_vars: true,
|
||||||
|
inline: true,
|
||||||
|
reduce_vars: true,
|
||||||
|
toplevel: true,
|
||||||
|
unused: true,
|
||||||
|
}
|
||||||
|
input: {
|
||||||
|
A = 42;
|
||||||
|
function f(b) {
|
||||||
|
return b >> 0;
|
||||||
|
}
|
||||||
|
var a = f(42 in []);
|
||||||
|
console.log(f(A));
|
||||||
|
}
|
||||||
|
expect: {
|
||||||
|
function f(b) {
|
||||||
|
return b >> 0;
|
||||||
|
}
|
||||||
|
A = 42;
|
||||||
|
console.log(A >> 0);
|
||||||
|
}
|
||||||
|
expect_stdout: "42"
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user