Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Freezing of Map values during finalization #1150

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

chetan-satpute
Copy link

Findings

Map keys are not enumerable properties of the Map object, so the propertyIsEnumerable check does not apply to them.
This fails the check in finalizeProperty of src/core/finalize.ts.

Changes

  • Added a condition to detect Map objects and uses Map.prototype.has to check for key existence.

Fixes #1119

Map keys are not enumerable properties of the Map object, so the propertyIsEnumerable check does not apply to them.

This commit adds a condition to detect Map objects and uses Map.prototype.has to check for key existence.

Fixes immerjs#1119.
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.

Object values of a Map are not frozen anymore
1 participant