fix corner cases in inline (#5375)
This commit is contained in:
@@ -10524,7 +10524,7 @@ Compressor.prototype.compress = function(node) {
|
||||
insert = scope.body.indexOf(child) + 1;
|
||||
if (!insert) return false;
|
||||
if (!safe_from_await_yield(fn, avoid_await_yield(scope))) return false;
|
||||
var safe_to_inject = exp !== fn || fn.parent_scope.resolve() === scope;
|
||||
var safe_to_inject = (exp !== fn || fn.parent_scope.resolve() === scope) && !scope.pinned();
|
||||
if (scope instanceof AST_Toplevel) {
|
||||
if (compressor.toplevel.vars) {
|
||||
defined.set("arguments", true);
|
||||
@@ -13252,6 +13252,7 @@ Compressor.prototype.compress = function(node) {
|
||||
if (!(fn instanceof AST_LambdaExpression)) return;
|
||||
if (fn.name) return;
|
||||
if (fn.uses_arguments) return;
|
||||
if (fn.pinned()) return;
|
||||
if (is_generator(fn)) return;
|
||||
var arrow = is_arrow(fn);
|
||||
if (arrow && fn.value) return;
|
||||
@@ -13267,6 +13268,7 @@ Compressor.prototype.compress = function(node) {
|
||||
scope = scope.parent_scope;
|
||||
}
|
||||
if (!member(scope, compressor.stack)) return;
|
||||
if (scope.pinned() && fn.variables.size() > (arrow ? 0 : 1)) return;
|
||||
if (scope instanceof AST_Toplevel) {
|
||||
if (fn.variables.size() > (arrow ? 0 : 1)) {
|
||||
if (!compressor.toplevel.vars) return;
|
||||
|
||||
Reference in New Issue
Block a user