fix corner case in inline (#5527)

fixes #5526
This commit is contained in:
Alex Lam S.L
2022-06-26 13:48:14 +01:00
committed by GitHub
parent fcc87edb71
commit f1b3e9df1e
11 changed files with 72 additions and 11 deletions

View File

@@ -13523,7 +13523,9 @@ Compressor.prototype.compress = function(node) {
return make_node(AST_If, self, {
condition: make_condition(self.left),
body: inlined,
alternative: no_return ? null : make_node(AST_Return, self, { value: null }),
alternative: no_return ? null : make_node(AST_Return, self, {
value: make_node(AST_Undefined, self).transform(compressor),
}),
});
function make_condition(cond) {
@@ -13723,7 +13725,9 @@ Compressor.prototype.compress = function(node) {
if (is_undefined(value)) return;
node.value = make_node(AST_Await, call, { expression: value });
});
body.push(make_node(AST_Return, call, { value: null }));
body.push(make_node(AST_Return, call, {
value: make_node(AST_Undefined, call).transform(compressor),
}));
}
return inlined;