diff options
author | Mihai Bazon <mihai@bazon.net> | 2012-11-01 15:14:56 +0200 |
---|---|---|
committer | Mihai Bazon <mihai@bazon.net> | 2012-11-01 15:14:56 +0200 |
commit | 18270dd9f371f1b5debad2521c4b9f7fce02051f (patch) | |
tree | 406aae345fcd28b42a3ccfa32fbb3d8693e3822d /lib | |
parent | d4c25c571bfac8e9bf91b2b894837d61370b0c35 (diff) | |
download | tracifyjs-18270dd9f371f1b5debad2521c4b9f7fce02051f.tar.gz tracifyjs-18270dd9f371f1b5debad2521c4b9f7fce02051f.zip |
added unsafe_comps for negating `<=` with `>`
since it has the potential to break code, let's keep it disabled by default
Diffstat (limited to 'lib')
-rw-r--r-- | lib/compress.js | 3 |
1 files changed, 2 insertions, 1 deletions
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; |