fix corner case in inline (#5367)

fixes #5366
This commit is contained in:
Alex Lam S.L
2022-02-21 03:31:29 +00:00
committed by GitHub
parent dd3b81dec6
commit 313e4974a4
2 changed files with 26 additions and 2 deletions

View File

@@ -13454,8 +13454,11 @@ Compressor.prototype.compress = function(node) {
inlined = inlined.try_inline(compressor, scope, true, in_loop);
if (inlined) {
this.init = null;
inlined.body.push(this);
return inlined;
if (inlined instanceof AST_BlockStatement) {
inlined.body.push(this);
return inlined;
}
return make_node(AST_BlockStatement, inlined, { body: [ inlined, this ] });
}
}
return body && this;