diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2020-08-26 12:45:38 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-26 19:45:38 +0800 |
commit | 3aa765e4296c4caf2f3b2b3e6b43b65caf05a28f (patch) | |
tree | fb8d8fc414de709ed60767fc9365e8f213ae40fe /lib | |
parent | 93d084a1d191379a55498a12f79f573e7bb1d1be (diff) | |
download | tracifyjs-3aa765e4296c4caf2f3b2b3e6b43b65caf05a28f.tar.gz tracifyjs-3aa765e4296c4caf2f3b2b3e6b43b65caf05a28f.zip |
fix corner case in `evaluate` (#4078)
fixes #4077
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 a1f3d50c..cd790db3 100644 --- a/lib/compress.js +++ b/lib/compress.js @@ -3502,7 +3502,8 @@ merge(Compressor.prototype, { var left = this.left._eval(compressor, ignore_side_effects, cached, depth); if (left === this.left) return this; if (this.operator == (left ? "||" : "&&")) return left; - var right = this.right._eval(compressor, ignore_side_effects, cached, depth); + var rhs_ignore_side_effects = ignore_side_effects && !(left && typeof left == "object"); + var right = this.right._eval(compressor, rhs_ignore_side_effects, cached, depth); if (right === this.right) return this; var result; switch (this.operator) { |