From 90410f9fc3538a5f267c38470490b83086d71b85 Mon Sep 17 00:00:00 2001 From: "Alex Lam S.L" Date: Sun, 20 Sep 2020 16:21:59 +0100 Subject: fix corner case in `unused` (#4134) fixes #4133 --- lib/compress.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'lib') 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"; -- cgit v1.2.3