enhance properties (#3721)

This commit is contained in:
Alex Lam S.L
2020-02-15 13:04:44 +00:00
committed by GitHub
parent 0d820e4c0a
commit f0a29902ac
2 changed files with 28 additions and 3 deletions

View File

@@ -7615,9 +7615,11 @@ merge(Compressor.prototype, {
value = value.fixed_value();
}
if (!value) return false;
return !(value instanceof AST_Lambda)
|| compressor.parent() instanceof AST_New
|| !value.contains_this();
if (!(value instanceof AST_Lambda)) return true;
var parent = compressor.parent();
if (parent.TYPE != "Call") return true;
if (parent.expression !== compressor.self()) return true;
return !value.contains_this();
}
OPT(AST_Sub, function(self, compressor) {