Skip to content

fix: preserve repeated buffer and DataView references - #29

Open
feritcemkahraman wants to merge 1 commit into
ungap:mainfrom
feritcemkahraman:fix/buffer-reference-identity
Open

feritcemkahraman wants to merge 1 commit into
ungap:mainfrom
feritcemkahraman:fix/buffer-reference-identity

Conversation

@feritcemkahraman

Copy link
Copy Markdown

Deserializing an object that references the same ArrayBuffer or DataView twice creates two separate objects. That also breaks Map lookups using one of those restored references.

Cache both restored types by their serialized record index, as the other types already do. The regression fails before the fix and checks repeated references, Map keys/values, and bytes through both serializer and JSON round trips. Regenerated the CJS and browser bundle outputs.

Validation: the full build and test suite pass with 100% statement, branch, function, and line coverage. Six additional ESM/browser-bundle round-trip checks pass. Terser used one worker locally; the browser/Node version matrix was not run. This does not change DataView slice handling in #28.

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.

1 participant