fix(javascript): join wide symbolic branch returns without call spreads

The block branch of the symbolic return flow already appended without a
call spread, but the adjacent if branch and both continuation-condition
joins still spread, so a generated wrapper with a wide tree of unknown
conditions could still overflow the argument limit.

Refs #10445

Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
This commit is contained in:
gensokyo-devandgensokyo-dev authored and Ysopwnable committed 2026-11-14 14:59:41 +01:00
1 parent 3ae23bfeff
commit 15825208c8
1 file changed
+5 -4
@@ -1399,7 +1399,7 @@ export class JavaScriptSymbolicBindings {
appendAll(possible, flow.values.map(guardCurrentPath));
if (!flow.fallsThrough)
return { values: possible, fallsThrough: false };
continuationConditions.push(...(flow.conditions ?? []));
appendAll(continuationConditions, flow.conditions ?? []);
unresolvedFallthrough ||= flow.conditionUnresolved === true;
}
if (t.isIfStatement(statement)) {
@@ -1416,8 +1416,9 @@ export class JavaScriptSymbolicBindings {
depth + 1,
),
);
possible.push(
...flows.flatMap((flow, index) =>
appendAll(
possible,
flows.flatMap((flow, index) =>
flow.values.map((value) => {
const guarded = guardCurrentPath(value);
return truth === undefined
@@ -1432,7 +1433,7 @@ export class JavaScriptSymbolicBindings {
if (flows.every((flow) => !flow.fallsThrough))
return { values: possible, fallsThrough: false };
if (truth !== undefined) {
continuationConditions.push(...(flows[0]?.conditions ?? []));
appendAll(continuationConditions, flows[0]?.conditions ?? []);
unresolvedFallthrough ||= flows[0]?.conditionUnresolved === true;
} else {
const fallthrough = flows.flatMap((flow, index) =>