fix corner case in inline (#5253)

fixes #5251
This commit is contained in:
Alex Lam S.L
2022-01-02 08:10:39 +00:00
committed by GitHub
parent aa6eb0d5be
commit f7841bc8b8
2 changed files with 22 additions and 0 deletions

View File

@@ -12925,6 +12925,7 @@ Compressor.prototype.compress = function(node) {
if (scope instanceof AST_Toplevel && fn.variables.size() > (arrow ? 0 : 1)) {
if (!compressor.toplevel.vars) return;
if (fn.functions.size() > 0 && !compressor.toplevel.funcs) return;
defined.set("arguments", true);
}
var async = is_async(fn);
if (async && !(compressor.option("awaits") && is_async(scope))) return;