Parent: #475 Related: #564, #565
Problem
Intl.NumberFormat.prototype.formatToParts currently special-cases BigInt by formatting the whole value through bigIntFormatWithResolved and emitting one literal part. A focused probe formats 12345678901234567890n as the correct visible text but reports no integer/group structure; system JavaScriptCore emits numeric part boundaries. Range consumers also need the same exact structural model rather than an opaque literal.
Scope
- Feed exact BigInt digits through the shared ordered NumberFormat emitter without converting through f64.
- Apply grouping, localized digits, signs/accounting, currency/unit/percent placement, and notation/rounding behavior permitted for BigInt while retaining exact integer magnitude.
- Make
format,formatToParts,formatRange, andformatRangeToPartsshare the same BigInt structure and range-affix logic.
No-workaround rules
No f64 conversion, value-length cutoff, ungrouped special case, opaque literal part, locale recognition, duplicated formatting algorithm, or borrowed bytes that outlive their owner.
Acceptance
- Focused exact-text and exact-part oracles cover zero, signs, very large magnitudes, grouping schemes, non-Latin digits, currency/unit/percent, compact/scientific notation, and ranges.
- BigInt
formatequals joinedformatToParts, with spec-correct part types and sources. - Relevant Intl402 and BigInt locale subtrees gain missing cases with no regressions.
- OOM, bounded heap, moving GC, no-GIL, TSan, allocation evidence, and full units pass.