diff options
author | Mihai Bazon <mihai@bazon.net> | 2012-09-17 14:33:36 +0300 |
---|---|---|
committer | Mihai Bazon <mihai@bazon.net> | 2012-09-17 14:33:36 +0300 |
commit | 6ad414ef28e64ff7c53ee89e737f4e9d7cd2f009 (patch) | |
tree | cf34ee322d38e148ecb2dc58f6a8a33f7a6674ef | |
parent | 45a3970ca35e0c640a761601d0854a4c7c5a5cf0 (diff) | |
download | tracifyjs-6ad414ef28e64ff7c53ee89e737f4e9d7cd2f009.tar.gz tracifyjs-6ad414ef28e64ff7c53ee89e737f4e9d7cd2f009.zip |
minor
-rw-r--r-- | lib/compress.js | 4 | ||||
-rw-r--r-- | test/compress/conditionals.js | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/compress.js b/lib/compress.js index ddbf41fa..a7472ce7 100644 --- a/lib/compress.js +++ b/lib/compress.js @@ -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 ] diff --git a/test/compress/conditionals.js b/test/compress/conditionals.js index 4dc27b85..8edc86e9 100644 --- a/test/compress/conditionals.js +++ b/test/compress/conditionals.js @@ -106,7 +106,7 @@ ifs_5: { if (baz) return; if (baa) return; a(); - b() + b(); } } expect: { |