aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMihai Bazon <mihai@bazon.net>2012-11-01 13:35:08 +0200
committerMihai Bazon <mihai@bazon.net>2012-11-01 13:35:08 +0200
commitd4c25c571bfac8e9bf91b2b894837d61370b0c35 (patch)
treedaec211214cb9f9ffd3807757595ebaaec1a15cd
parent5248b79506d80c7da8b8a50225fe0bb48e607346 (diff)
downloadtracifyjs-d4c25c571bfac8e9bf91b2b894837d61370b0c35.tar.gz
tracifyjs-d4c25c571bfac8e9bf91b2b894837d61370b0c35.zip
fix compressing UnaryPrefix
only try negating the expression if the operator is `!` #kendo
-rw-r--r--lib/compress.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/compress.js b/lib/compress.js
index ee255d78..c3b76118 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -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];