From: Mihai Bazon Date: Thu, 1 Nov 2012 11:35:08 +0000 (+0200) Subject: fix compressing UnaryPrefix X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=d4c25c571bfac8e9bf91b2b894837d61370b0c35;p=UglifyJS.git fix compressing UnaryPrefix only try negating the expression if the operator is `!` #kendo --- 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];