You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Fixesimmerjs#1119.
🐛 Bug Report
Starting with Immer 10.0.4,
enableMapSet()
does not seem to work as expected as values (if objects) of a nativeMap
aren't frozen anymore.Link to repro
https://stackblitz.com/edit/immer-10-0-4-map-bug
To Reproduce
Create a Map with objects by using
produce
and check the values of the Map withObject.isFrozen(...)
.Observed behavior
Objects inside a Map are not frozen.
Expected behavior
Objects inside a Map are frozen. The provided repo works if the Immer version is set to 10.0.3.
Environment
The text was updated successfully, but these errors were encountered: