aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2020-09-20 16:21:59 +0100
committerGitHub <noreply@github.com>2020-09-20 23:21:59 +0800
commit90410f9fc3538a5f267c38470490b83086d71b85 (patch)
tree5063448f09c1fb33e7839f66855632069978e381 /lib
parentef3831437d830714178b7342a120ee6c8bf082c4 (diff)
downloadtracifyjs-90410f9fc3538a5f267c38470490b83086d71b85.tar.gz
tracifyjs-90410f9fc3538a5f267c38470490b83086d71b85.zip
fix corner case in `unused` (#4134)
fixes #4133
Diffstat (limited to 'lib')
-rw-r--r--lib/compress.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/compress.js b/lib/compress.js
index 1f86c5b6..2df76f5f 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -2906,9 +2906,12 @@ merge(Compressor.prototype, {
var fixed = this.fixed_value();
if (!fixed) return true;
this._dot_throw = return_true;
- var result = fixed._dot_throw(compressor);
- delete this._dot_throw;
- return result;
+ if (fixed._dot_throw(compressor)) {
+ delete this._dot_throw;
+ return true;
+ }
+ this._dot_throw = return_false;
+ return false;
});
def(AST_UnaryPrefix, function() {
return this.operator == "void";