aboutsummaryrefslogtreecommitdiff
path: root/lib/compress.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2019-05-15 01:01:18 +0800
committerGitHub <noreply@github.com>2019-05-15 01:01:18 +0800
commit1f0def10ebc637ddd6c24094942ae616f94ed25f (patch)
tree139388e335d0ac1b301d4e982ba76ea35aef3174 /lib/compress.js
parentf87caac9d89061ce005c56384e08fd94ca80d94c (diff)
downloadtracifyjs-1f0def10ebc637ddd6c24094942ae616f94ed25f.tar.gz
tracifyjs-1f0def10ebc637ddd6c24094942ae616f94ed25f.zip
fix corner case in `comparisons` (#3414)
fixes #3413
Diffstat (limited to 'lib/compress.js')
-rw-r--r--lib/compress.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/compress.js b/lib/compress.js
index 3bb6cb24..f7730cd5 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -2348,7 +2348,7 @@ merge(Compressor.prototype, {
case "&&":
return this.left.is_defined(compressor) && this.right.is_defined(compressor);
case "||":
- return this.left.is_defined(compressor) || this.right.is_defined(compressor);
+ return this.left.is_truthy() || this.right.is_defined(compressor);
default:
return true;
}
@@ -2368,7 +2368,7 @@ merge(Compressor.prototype, {
if (this.is_immutable()) return true;
var fixed = this.fixed_value();
if (!fixed) return false;
- this.is_defined = return_true;
+ this.is_defined = return_false;
var result = fixed.is_defined(compressor);
delete this.is_defined;
return result;