fix corner cases in merge_vars (#5457)

fixes #5456
This commit is contained in:
Alex Lam S.L
2022-05-18 23:39:20 +01:00
committed by GitHub
parent 33c9c48318
commit 27aa85f84b
3 changed files with 89 additions and 5 deletions

View File

@@ -6184,7 +6184,7 @@ Compressor.prototype.compress = function(node) {
}
if (node instanceof AST_Scope) {
var in_iife = false;
if (node instanceof AST_LambdaExpression && !node.name) {
if (node instanceof AST_LambdaExpression && !node.name && !is_async(node) && !is_generator(node)) {
var parent = tw.parent();
in_iife = parent && parent.TYPE == "Call" && parent.expression === node;
}