Skip to content

Conversation

pi0
Copy link
Contributor

@pi0 pi0 commented Apr 8, 2025

There is a common pattern that libraries like ufo and cookie use to have a custom class with null prototype instead of Object.create(null) to improve (v8) performance.

This PR fixes the devalue behavior to support this pattern.

Since there is no obvious way to distinguish {} and new NullProto() (both have prototype of [Object: null prototype]), they are serialized as normal object (with prop oveerrides)

Copy link

changeset-bot bot commented Aug 26, 2025

🦋 Changeset detected

Latest commit: 2dfa504

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Member

@Rich-Harris Rich-Harris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you!

@Rich-Harris Rich-Harris merged commit 8d83fb9 into sveltejs:main Aug 26, 2025
3 checks passed
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