Parents: #475, #460 Follow-up to: #580 Related: #581, #493
Problem
#580 made bound compare consume immutable native Collator state, but constructor publication still retains a hidden \0opts JavaScript object and stores the pre-ResolveLocale tag in the native record. Every resolvedOptions() call generically traverses that object, reruns co/kf/kn extension resolution, allocates a temporary locale result, and reflects it. Because the receiver path trusts forgeable NUL-led properties before consulting the native record, a fabricated ordinary object can also pass the current resolvedOptions brand check.
Repeated reflection therefore pays avoidable synchronized property/GC work, and native compare state is not yet the complete immutable resolved state claimed by its ownership boundary.
Scope
- Freeze a dependency-free repeated
resolvedOptions()row across default, search, numeric, case-first, sensitivity, punctuation, supported collation, and Unicode-extension configurations, hashing every reflected field with a checksum shared by zig-js and system JSC. - Preserve exact InitializeCollator getter/coercion/throw order and ResolveLocale behavior for
co,kf, andkn, including extension retention/removal under equal, overriding, and unsupported option values. - Publish the final resolved locale spelling and every reflected option in the object-owned, GC-finalized native Collator record after all observable reads succeed.
- Remove the hidden normalized-options object. Make compare access/invocation and
resolvedOptions()require the unforgeable native record while preserving callable-constructor and bound-function identity semantics. - Reflect closed fields through immutable static values; locale output remains an independently owned ordinary result string.
Security and no-workaround rules
Locales, options, property getters, coercion hooks, receiver properties, and call frequency are attacker-controlled. No result cache, source/workload recognition, skipped getter, weakened brand, predictable lookup shortcut, unbounded retained state, or locale-specific repro branch is allowed.
Acceptance
- The benchmark boundary is committed before runtime work and exact checksums match system JSC.
- Proxy/throwing getters prove exact option observation and no later rereads; forged NUL-led properties fail at the required receiver check.
- Resolved locale/fields cover default and
co/kf/knequal/override/removal cases. - Constructor OOM rollback, bounded repeated reflection, moving GC, shared-realm no-GIL reads, and suppression-free TSan pass.
- Exact-parent attribution reports locks, backing allocations/bytes, GC cells/collections, RSS, and order-balanced timing without hiding bounded record cost.
- Collator test262, full Intl402, and the full sharded unit suite do not regress.
Exclusions
No Promise, microtask, Worker, queue, job-lifecycle, stack, or user-owned documentation work.