Commit Graph
1 Commits
Author SHA1 Message Date
Malte UblandClaude Opus 5.5 fc407d0751 Lower Array.prototype.join over a dynamic separator
`.join(sep)` over a checked-dynamic separator fenced with SC2020. JS
substitutes the default comma only for the undefined VALUE; every other
value goes through ToString, which prints "null" for null, the digits for
a number or boolean, and throws the catchable TypeError for a symbol.
Evaluate the separator once into a hidden local, test it against the
undefined dyn kind, and answer either the comma literal or
dyn.toStringCoerce of the value.

Unlike the statically typed arms (string, and a union with an undefined
arm), a dynamic separator cannot be resolved statically, so this is the
runtime test the dynamic tier exists for.

Fixes the 2 pi sites (@anthropic-ai/sdk's node.mjs, pi's
interactive-mode.ts).

Evidence: tests/corpus/array-join-dynamic-separator.ts, run under Node and
natively in the plain and sanitized differential lanes, plus its
order-parity baseline.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 08:50:54 -07:00