enhance inline (#3352)

This commit is contained in:
Alex Lam S.L
2019-03-21 02:58:33 +08:00
committed by GitHub
parent 65648d84a5
commit 54b0b49b68
2 changed files with 29 additions and 1 deletions

View File

@@ -5072,7 +5072,7 @@ merge(Compressor.prototype, {
}
} while (!(scope instanceof AST_Scope));
var safe_to_inject = (!(scope instanceof AST_Toplevel) || compressor.toplevel.vars)
&& fn.parent_scope === compressor.find_parent(AST_Scope);
&& (exp !== fn || fn.parent_scope === compressor.find_parent(AST_Scope));
var inline = compressor.option("inline");
if (!can_inject_vars(catches, inline >= 3 && safe_to_inject)) return false;
if (!can_inject_args(catches, inline >= 2 && safe_to_inject)) return false;