aboutsummaryrefslogtreecommitdiff
path: root/lib/compress.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2020-06-09 03:33:47 +0100
committerGitHub <noreply@github.com>2020-06-09 10:33:47 +0800
commitd764b6cc3b3af1b42d06fffb820006105172061f (patch)
treed516281284741792447ddb4328a4094cfadbdb90 /lib/compress.js
parent08c4729eb45e0e7d5ab34a8ffa814b6093822930 (diff)
downloadtracifyjs-d764b6cc3b3af1b42d06fffb820006105172061f.tar.gz
tracifyjs-d764b6cc3b3af1b42d06fffb820006105172061f.zip
fix corner case in `reduce_vars` (#3975)
fixes #3974
Diffstat (limited to 'lib/compress.js')
-rw-r--r--lib/compress.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/compress.js b/lib/compress.js
index d82c8124..907c9e75 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -4032,7 +4032,9 @@ merge(Compressor.prototype, {
return all(this.elements);
});
def(AST_Binary, function() {
- return this.left.is_constant_expression() && this.right.is_constant_expression();
+ return this.left.is_constant_expression()
+ && this.right.is_constant_expression()
+ && (this.operator != "in" || is_object(this.right.tail_node()));
});
def(AST_Constant, return_true);
def(AST_Lambda, function(scope) {