fix corner case in merge_vars (#5830)

fixes #5829
This commit is contained in:
Alex Lam S.L
2024-06-08 20:15:37 +03:00
committed by GitHub
parent 09910771a1
commit 2cb6454b1f
2 changed files with 43 additions and 1 deletions

View File

@@ -6719,9 +6719,11 @@ Compressor.prototype.compress = function(node) {
segments.consequent = scan_branches(level + 1, condition.left, condition.right).consequent;
break;
case "||":
case "??":
segments.alternative = scan_branches(level + 1, condition.left, null, condition.right).alternative;
break;
case "??":
segments.alternative = scan_branches(level + 1, condition.left, condition.right, condition.right).alternative;
break;
default:
condition.walk(tw);
break;