aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorkzc <zaxxon2011@gmail.com>2017-02-18 19:02:59 +0800
committeralexlamsl <alexlamsl@gmail.com>2017-02-21 13:29:57 +0800
commitd11dca3cf9e34302ce12a6c9f1cd81b22551f2ba (patch)
treeff896e3240b131545837b90d73487c4ffb8945ca /lib
parente5badb954157d41dba3cc74f8813a90a145d9ca3 (diff)
downloadtracifyjs-d11dca3cf9e34302ce12a6c9f1cd81b22551f2ba.tar.gz
tracifyjs-d11dca3cf9e34302ce12a6c9f1cd81b22551f2ba.zip
fix stray else in compress with conditionals=false
closes #1449
Diffstat (limited to 'lib')
-rw-r--r--lib/compress.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/compress.js b/lib/compress.js
index b49ebef2..459256f5 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -1840,6 +1840,8 @@ merge(Compressor.prototype, {
});
OPT(AST_If, function(self, compressor){
+ if (is_empty(self.alternative)) self.alternative = null;
+
if (!compressor.option("conditionals")) return self;
// if condition can be statically determined, warn and drop
// one of the blocks. note, statically determined implies
@@ -1868,7 +1870,6 @@ merge(Compressor.prototype, {
}
}
}
- if (is_empty(self.alternative)) self.alternative = null;
var negated = self.condition.negate(compressor);
var self_condition_length = self.condition.print_to_string().length;
var negated_length = negated.print_to_string().length;