fix compressing UnaryPrefix
authorMihai Bazon <mihai@bazon.net>
Thu, 1 Nov 2012 11:35:08 +0000 (13:35 +0200)
committerMihai Bazon <mihai@bazon.net>
Thu, 1 Nov 2012 11:35:08 +0000 (13:35 +0200)
only try negating the expression if the operator is `!`

#kendo

lib/compress.js

index ee255d7..c3b7611 100644 (file)
@@ -1446,7 +1446,7 @@ merge(Compressor.prototype, {
                 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));
         }
         return self.evaluate(compressor)[0];