fix corner case in inline (#5693)

fixes #5692
This commit is contained in:
Alex Lam S.L
2022-10-03 01:01:56 +01:00
committed by GitHub
parent 80fc862547
commit 140e4e0da8
3 changed files with 83 additions and 1 deletions

View File

@@ -13888,7 +13888,10 @@ Compressor.prototype.compress = function(node) {
var abort = false;
stat.walk(new TreeWalker(function(node) {
if (abort) return true;
if (async && node instanceof AST_Await || node instanceof AST_Return) return abort = true;
if (async && (node instanceof AST_Await || node instanceof AST_ForAwaitOf)
|| node instanceof AST_Return) {
return abort = true;
}
if (node instanceof AST_Scope) return true;
}));
return !abort;