fix corner case in inline (#5402)

fixes #5401
This commit is contained in:
Alex Lam S.L
2022-04-02 18:12:53 +01:00
committed by GitHub
parent 8065e27a7d
commit 224c91b6c1
2 changed files with 26 additions and 0 deletions

View File

@@ -13508,6 +13508,12 @@ Compressor.prototype.compress = function(node) {
def(AST_LabeledStatement, function(compressor, scope, no_return, in_loop) {
var body = this.body.try_inline(compressor, scope, no_return, in_loop);
if (!body) return;
if (this.body instanceof AST_IterationStatement && body instanceof AST_BlockStatement) {
var loop = body.body.pop();
this.body = loop;
body.body.push(this);
return body;
}
this.body = body;
return this;
});