fix corner case in inline (#5329)

fixes #5328
This commit is contained in:
Alex Lam S.L
2022-02-01 11:35:03 +00:00
committed by GitHub
parent 93105f1a6d
commit 77552d9e69
2 changed files with 22 additions and 3 deletions

View File

@@ -13170,9 +13170,11 @@ Compressor.prototype.compress = function(node) {
scope = scope.parent_scope;
}
if (!member(scope, compressor.stack)) return;
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;
if (scope instanceof AST_Toplevel) {
if (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);