Parent: #480 Related: #460, #472, #478, #493
Problem
Generic Array methods route array-like, sparse, inherited, accessor, typed-array, and Proxy indices through arrIndexPresent, arrIndexGet, arrIndexSetOrThrow, arrIndexDeleteOrThrow, and related result/set helpers. These helpers currently format ToString(index) with allocPrint(self.arena, ...). The key is consumed synchronously by [[HasProperty]], [[Get]], [[Set]], [[Delete]], or CreateDataProperty, but its temporary bytes remain in Context backing. Repeated generic forEach/map/filter/search/shift-style traversal therefore retains O(iterations × logical length) decimal-key storage and adds allocator work to every observed index.
Scope
- Format numeric property keys in bounded native storage wherever the callee consumes or copies the key synchronously.
- Preserve exact ECMA-262 ordering for
length, per-indexHasProperty,Get, callback,Set,Delete, and result definition. - Keep dense-array and typed-array fast paths unchanged unless exact evidence supports a retained improvement.
- Cover plain array-likes, holes with inherited properties, accessors, Proxies, mutation during callbacks, exotic result species, and throwing traps.
- Audit every converted sink to prove borrowed bytes cannot escape; storage sites must establish owned key lifetime before return.
No-workaround rules
- No dense-only shortcut presented as generic support, skipped holes/traps/callbacks, snapshotted input, capped ordinary length, cached user-visible keys, unbounded realm/process cache, or bypass of property attributes/prototype setters.
- OOM from a property operation or owned-key publication must propagate without partial extra mutation or leaks.
Acceptance
- Deterministic 1K/2K/4K generic array-like rows, a sparse Proxy row, and a dense-array control preserve frozen checksums.
- Exact-parent wall/instruction/allocation/RSS evidence attributes numeric-key retention and rejects dense-control regression.
- Proxy/accessor/inherited-hole ordering and callback-time mutation match the specification.
- Set/Delete/result-definition paths copy borrowed keys before they escape; OOM is rollback-safe and leak-free.
- Moving GC, bounded heap, no-GIL, focused TSan, full units, and affected
test/built-ins/Array/prototypesubtrees pass with nonzero denominators.
Security boundary
Logical length and Proxy behavior are attacker-controlled. Work must remain proportional to the specified traversal while temporary native storage stays bounded independently of the number of visited indices.