aboutsummaryrefslogtreecommitdiff
path: root/lib/compress.js
diff options
context:
space:
mode:
authorMihai Bazon <mihai@bazon.net>2012-09-12 16:29:20 +0300
committerMihai Bazon <mihai@bazon.net>2012-09-12 16:29:20 +0300
commitf5027ec1fc67d6daeb51714eeddd06350cae00d6 (patch)
tree62a05c30c8c5107e92b9c28e8fe0794ccc77bd26 /lib/compress.js
parenta132841fb920f6815eb6d153f4329242354f1cae (diff)
downloadtracifyjs-f5027ec1fc67d6daeb51714eeddd06350cae00d6.tar.gz
tracifyjs-f5027ec1fc67d6daeb51714eeddd06350cae00d6.zip
minor
Diffstat (limited to 'lib/compress.js')
-rw-r--r--lib/compress.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/compress.js b/lib/compress.js
index 02b9e243..efdc6d83 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -833,17 +833,17 @@ function Compressor(options, false_by_default) {
&& index < block.length - 1) {
if (compressor.parent() instanceof AST_Lambda) {
var rest = tighten_body(block.slice(index + 1), compressor);
- var cond = negated_is_best ? negated : self.condition.negate(compressor);
+ var cond = self.condition;
while (rest[0] instanceof AST_If && rest[0].body instanceof AST_Return && !rest[0].alternative) {
cond = make_node(AST_Binary, rest[0], {
- operator: "&&",
+ operator: "||",
left: cond,
- right: rest[0].condition.negate(compressor)
+ right: rest[0].condition
});
rest.shift();
}
return MAP.last(make_node(AST_If, self, {
- condition: cond,
+ condition: cond.negate(compressor),
body: make_node(AST_BlockStatement, block[index + 1], {
body: rest
}).optimize(compressor)