fix compressing UnaryPrefix

only try negating the expression if the operator is `!`

#kendo
This commit is contained in:
Mihai Bazon
2012-11-01 13:35:08 +02:00
parent 5248b79506
commit d4c25c571b

View File

@@ -1446,7 +1446,7 @@ merge(Compressor.prototype, {
return make_node(AST_True, self); return make_node(AST_True, self);
} }
} }
if (e instanceof AST_Binary) { if (e instanceof AST_Binary && self.operator == "!") {
self = best_of(self, e.negate(compressor)); self = best_of(self, e.negate(compressor));
} }
return self.evaluate(compressor)[0]; return self.evaluate(compressor)[0];