fix corner cases in if_return (#5590)
fixes #5589 fixes #5591 fixes #5592
This commit is contained in:
@@ -3664,17 +3664,19 @@ Compressor.prototype.compress = function(node) {
|
||||
var value = ab.value;
|
||||
if (value && !is_undefined(value.tail_node())) return false;
|
||||
if (!(self instanceof AST_SwitchBranch)) return true;
|
||||
if (jump instanceof AST_Break) {
|
||||
merge_jump = 4;
|
||||
} else if (jump instanceof AST_Exit && !jump.value) {
|
||||
merge_jump = true;
|
||||
}
|
||||
if (!jump) return false;
|
||||
if (jump instanceof AST_Exit && jump.value) return false;
|
||||
merge_jump = 4;
|
||||
return true;
|
||||
}
|
||||
if (!(ab instanceof AST_LoopControl)) return false;
|
||||
if (jump && self instanceof AST_SwitchBranch) {
|
||||
if (jump instanceof AST_Exit && jump.value) return false;
|
||||
if (compressor.loopcontrol_target(jump) instanceof AST_IterationStatement) return false;
|
||||
if (jump instanceof AST_Exit) {
|
||||
if (!in_lambda) return false;
|
||||
if (jump.value) return false;
|
||||
} else if (compressor.loopcontrol_target(jump) !== parent) {
|
||||
return false;
|
||||
}
|
||||
merge_jump = true;
|
||||
}
|
||||
var lct = compressor.loopcontrol_target(ab);
|
||||
|
||||
Reference in New Issue
Block a user