From 18270dd9f371f1b5debad2521c4b9f7fce02051f Mon Sep 17 00:00:00 2001 From: Mihai Bazon Date: Thu, 1 Nov 2012 15:14:56 +0200 Subject: [PATCH] added unsafe_comps for negating `<=` with `>` since it has the potential to break code, let's keep it disabled by default --- lib/compress.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/compress.js b/lib/compress.js index c3b76118..04fb7855 100644 --- a/lib/compress.js +++ b/lib/compress.js @@ -53,6 +53,7 @@ function Compressor(options, false_by_default) { dead_code : !false_by_default, drop_debugger : !false_by_default, unsafe : !false_by_default, + unsafe_comps : false, conditionals : !false_by_default, comparisons : !false_by_default, evaluate : !false_by_default, @@ -703,7 +704,7 @@ merge(Compressor.prototype, { }); def(AST_Binary, function(compressor){ var self = this.clone(), op = this.operator; - if (compressor.option("comparisons") && compressor.option("unsafe")) { + if (compressor.option("unsafe_comps")) { switch (op) { case "<=" : self.operator = ">" ; return self; case "<" : self.operator = ">=" ; return self; -- 2.34.1