minor
authorMihai Bazon <mihai@bazon.net>
Mon, 17 Sep 2012 11:33:36 +0000 (14:33 +0300)
committerMihai Bazon <mihai@bazon.net>
Mon, 17 Sep 2012 11:33:36 +0000 (14:33 +0300)
lib/compress.js
test/compress/conditionals.js

index ddbf41f..a7472ce 100644 (file)
@@ -993,7 +993,7 @@ function Compressor(options, false_by_default) {
             }
         }
         if (is_empty(self.alternative)) self.alternative = null;
-        var negated = self.condition.negate(compressor);
+        var negated = self.condition.negate(compressor).optimize(compressor);
         var negated_is_best = best_of(self.condition, negated) === negated;
         if (self.alternative && negated_is_best) {
             negated_is_best = false; // because we already do the switch here.
@@ -1077,7 +1077,7 @@ function Compressor(options, false_by_default) {
         if (aborts(self.alternative)) {
             var body = self.body;
             self.body = self.alternative;
-            self.condition = negated_is_best ? negated : self.condition.negate(compressor);
+            self.condition = negated_is_best ? negated : self.condition.negate(compressor).optimize(compressor);
             self.alternative = null;
             return make_node(AST_BlockStatement, self, {
                 body: [ self, body ]
index 4dc27b8..8edc86e 100644 (file)
@@ -106,7 +106,7 @@ ifs_5: {
             if (baz) return;
             if (baa) return;
             a();
-            b()
+            b();
         }
     }
     expect: {