mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Fix console warning in LegacyImmutableObject
It does check `hasOwnProperty`, but *after* accessing the field and therefore triggering enumerable getters in modified prototypes.
This commit is contained in:
committed by
Paul O’Shannessy
parent
944f49c264
commit
335e91df71
@@ -81,9 +81,11 @@ if (__DEV__) {
|
||||
}
|
||||
Object.freeze(object); // First freeze the object.
|
||||
for (var prop in object) {
|
||||
var field = object[prop];
|
||||
if (object.hasOwnProperty(prop) && shouldRecurseFreeze(field)) {
|
||||
deepFreeze(field);
|
||||
if (object.hasOwnProperty(prop)) {
|
||||
var field = object[prop];
|
||||
if (shouldRecurseFreeze(field)) {
|
||||
deepFreeze(field);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user