enhance inline (#5535)
This commit is contained in:
@@ -13553,7 +13553,6 @@ Compressor.prototype.compress = function(node) {
|
||||
if (fn.body[0] instanceof AST_Directive) return;
|
||||
if (fn.contains_this()) return;
|
||||
if (!scope) scope = find_scope(compressor);
|
||||
if (in_async_generator(scope)) return;
|
||||
var defined = new Dictionary();
|
||||
defined.set("NaN", true);
|
||||
while (!(scope instanceof AST_Scope)) {
|
||||
@@ -13624,7 +13623,7 @@ Compressor.prototype.compress = function(node) {
|
||||
}));
|
||||
return !abort;
|
||||
};
|
||||
} else if (in_await && !is_async(fn)) {
|
||||
} else if (in_await && !is_async(fn) || in_async_generator(scope)) {
|
||||
verify_body = function(stat) {
|
||||
var abort = false;
|
||||
var find_return = new TreeWalker(function(node) {
|
||||
@@ -13735,7 +13734,7 @@ Compressor.prototype.compress = function(node) {
|
||||
node.value = make_node(AST_Await, call, { expression: value });
|
||||
});
|
||||
body.push(make_node(AST_Return, call, {
|
||||
value: make_node(AST_Undefined, call).transform(compressor),
|
||||
value: in_async_generator(scope) ? make_node(AST_Undefined, call).transform(compressor) : null,
|
||||
}));
|
||||
}
|
||||
return inlined;
|
||||
|
||||
Reference in New Issue
Block a user