fix corner case in unused (#4134)

fixes #4133
This commit is contained in:
Alex Lam S.L
2020-09-20 16:21:59 +01:00
committed by GitHub
parent ef3831437d
commit 90410f9fc3
2 changed files with 27 additions and 3 deletions

View File

@@ -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";