fix corner case in dead_code (#3991)
This commit is contained in:
@@ -7865,12 +7865,10 @@ merge(Compressor.prototype, {
|
||||
if (self.left instanceof AST_PropAccess) {
|
||||
if (self.operator == "=") {
|
||||
if (self.__drop) {
|
||||
var props = [];
|
||||
flatten(self.left, props);
|
||||
flatten(self.right, props);
|
||||
return props.length == 0 ? make_node(AST_Number, self, {
|
||||
value: 0
|
||||
}) : make_sequence(self, props).optimize(compressor);
|
||||
var exprs = [ self.left.expression ];
|
||||
if (self.left instanceof AST_Sub) exprs.push(self.left.property);
|
||||
exprs.push(self.right);
|
||||
return make_sequence(self, exprs).optimize(compressor);
|
||||
}
|
||||
if (self.left.equivalent_to(self.right) && !self.left.has_side_effects(compressor)) {
|
||||
return self.right;
|
||||
@@ -7962,11 +7960,6 @@ merge(Compressor.prototype, {
|
||||
}
|
||||
return try_evaluate(compressor, self);
|
||||
|
||||
function flatten(node, props) {
|
||||
if (!(node.expression instanceof AST_SymbolRef)) props.push(node.expression);
|
||||
if (node instanceof AST_Sub) props.push(node.property);
|
||||
}
|
||||
|
||||
function in_try(level, node) {
|
||||
var right = self.right;
|
||||
self.right = make_node(AST_Null, right);
|
||||
|
||||
Reference in New Issue
Block a user