Skip to content

fix(replacer): sort extra typed array keys - #91

Draft
BridgeAR wants to merge 2 commits into
mainfrom
BridgeAR/2026-11-30-typed-array-replacer-order
Draft

BridgeAR wants to merge 2 commits into
mainfrom
BridgeAR/2026-11-30-typed-array-replacer-order

Conversation

@BridgeAR

Copy link
Copy Markdown
Owner

Deterministic sorting applies to extra typed-array properties when a replacer function is present. The indices keep their numeric order.

This ports #90 by Mradul Singh. The follow-up uses the intrinsic length to handle a shadowed length property. It keeps the existing index keys in place and skips sorting work for one-key inputs.

bardrop and others added 2 commits November 30, 2026 16:36
With deterministic enabled, extra properties on a typed array were sorted
without a replacer, but kept insertion order with a replacer function.
Sort them in the replacer function path as well.
A typed array can have a length property that shadows the intrinsic
getter. Using that property can pass numeric indices to the comparator.

Copying the index keys also costs CPU when maximumBreadth excludes every
extra key. Keep the existing index prefix when sorting the extra keys.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants