aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2019-04-25 15:15:50 +0800
committerGitHub <noreply@github.com>2019-04-25 15:15:50 +0800
commite5436ca5665378d67bb228704736d1fe5fa7b6ee (patch)
tree6443f5770a5b67676a26e94ad913f705d6578680 /lib
parentcfde686eab4ddaf0fc38b638462c3613b18c6ad4 (diff)
downloadtracifyjs-e5436ca5665378d67bb228704736d1fe5fa7b6ee.tar.gz
tracifyjs-e5436ca5665378d67bb228704736d1fe5fa7b6ee.zip
enhance `side_effects` (#3384)
Diffstat (limited to 'lib')
-rw-r--r--lib/compress.js12
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/compress.js b/lib/compress.js
index 13fc953d..a7585a60 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -4172,10 +4172,8 @@ merge(Compressor.prototype, {
var right = this.right.drop_side_effect_free(compressor, first_in_statement);
if (!right) return this.left.drop_side_effect_free(compressor, first_in_statement);
if (lazy_op[this.operator]) {
- var node;
- if (right === this.right) {
- node = this;
- } else {
+ var node = this;
+ if (right !== node.right) {
node = this.clone();
node.right = right.drop_side_effect_free(compressor);
}
@@ -4559,14 +4557,14 @@ merge(Compressor.prototype, {
operator : "||",
left : negated,
right : self.body.body
- })
+ }).transform(compressor)
}).optimize(compressor);
return make_node(AST_SimpleStatement, self, {
body: make_node(AST_Binary, self, {
operator : "&&",
left : self.condition,
right : self.body.body
- })
+ }).transform(compressor)
}).optimize(compressor);
}
if (self.body instanceof AST_EmptyStatement
@@ -4576,7 +4574,7 @@ merge(Compressor.prototype, {
operator : "||",
left : self.condition,
right : self.alternative.body
- })
+ }).transform(compressor)
}).optimize(compressor);
}
if (self.body instanceof AST_Exit