retain @__PURE__ call when return value is used (#3874)

This commit is contained in:
Alex Lam S.L
2020-05-10 18:07:05 +01:00
committed by GitHub
parent 63adfb1590
commit 7e0ad232b0
2 changed files with 26 additions and 0 deletions

View File

@@ -3499,6 +3499,7 @@ merge(Compressor.prototype, {
if (fn instanceof AST_Lambda) {
if (fn.evaluating) return this;
if (fn.name && fn.name.definition().recursive_refs > 0) return this;
if (this.is_expr_pure(compressor)) return this;
var stat = fn.first_statement();
if (!(stat instanceof AST_Return)) return this;
var args = eval_args(this.args);