aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMihai Bazon <mihai.bazon@gmail.com>2015-07-22 16:53:25 +0300
committerMihai Bazon <mihai.bazon@gmail.com>2015-07-22 16:55:55 +0300
commit905b6011784ca60d41919ac1a499962b7c1d4b02 (patch)
treeda15abdd808cefbb9ef794385dd0c5c397f51683 /lib
parent63fb2d5a44db3d583b1927c8daa244bf9f4d8dd2 (diff)
downloadtracifyjs-905b6011784ca60d41919ac1a499962b7c1d4b02.tar.gz
tracifyjs-905b6011784ca60d41919ac1a499962b7c1d4b02.zip
Don't attempt to negate non-boolean AST_Binary
Fix #751
Diffstat (limited to 'lib')
-rw-r--r--lib/compress.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/compress.js b/lib/compress.js
index 54873f0d..4c4cf977 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -2183,7 +2183,7 @@ merge(Compressor.prototype, {
}
break;
}
- if (compressor.option("comparisons")) {
+ if (compressor.option("comparisons") && self.is_boolean()) {
if (!(compressor.parent() instanceof AST_Binary)
|| compressor.parent() instanceof AST_Assign) {
var negated = make_node(AST_UnaryPrefix, self, {