Repository navigation
Keep extension packers distinct for same-name constructors - #167
Open
Aschenbath wants to merge 2 commits into
Open
Aschenbath wants to merge 2 commits into
Aschenbath wants to merge 2 commits into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Registering two independent constructors named
Messagecurrently causes instances of the first to be encoded with the second constructor's extension type. Re-registering either constructor also changes the other, and a custom constructor namedDatecan replace the preset Date encoder.Retain constructor identity for the named fast path and preserve displaced packers in the existing identity fallback list. Registered constructors with the same name then keep their own packers, while the name fallback remains available for values from another realm. Unique preset constructors stay on the fast path and do not populate the linear fallback list.
The regression cases run against both the source entry point and the tracked minified bundle. They cover name collisions, repeated registration, preset collisions, and unnamed/Object fallback constructors in both Node and the browser suite. Separate Node tests preserve cross-realm Date and typed-array compatibility. The six collision cases fail against unchanged upstream.
Validation on Node 24.22.0:
node --test test/*.js: all 215 tests pass.Prepared with Codex assistance; reproduced, reviewed, and validated locally.