mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-22 05:59:31 +08:00
`s + n`, multi-part concatenations with number operands, and `s += a + n` materialized each number as a temporary heap string, and a compound suffix as a second string, before copying them into the result. A new runtime entry, scr_str_concat_mixed, takes string and number operands together and formats numbers directly into the result. Given a head, it follows scr_str_concat's left-operand rule: appended in place when the caller's borrow is its only reference, it has room, and it is not also an operand. The self-concatenation assignment now flattens its suffix and appends every operand to the snapshot in one call, so tsc-ts's typeListKey loop (`key += (i === 0 ? '' : ',') + types[i].id`) appends in place without allocating per element. Operands still evaluate left to right; converting a number has no effects, so formatting it at the call keeps JavaScript order. A corpus program pins Number::toString shapes, evaluation order, self-referencing suffixes, aliases taken mid-append and Unicode text.