fix corner case in ie8 (#4232)

fixes #4231
This commit is contained in:
Alex Lam S.L
2020-10-20 07:02:39 +01:00
committed by GitHub
parent 256950c2c0
commit fd8c0212b8
4 changed files with 46 additions and 6 deletions

View File

@@ -5906,10 +5906,7 @@ merge(Compressor.prototype, {
this.write_only = !exp.has_side_effects(compressor);
return this;
}
if (this.operator == "typeof" && exp instanceof AST_SymbolRef) {
if (drop_symbol(exp)) return null;
if (exp.is_declared(compressor)) return exp;
}
if (this.operator == "typeof" && exp instanceof AST_SymbolRef && drop_symbol(exp)) return null;
var node = exp.drop_side_effect_free(compressor, first_in_statement);
if (first_in_statement && node && is_iife_call(node)) {
if (node === exp && this.operator == "!") return this;