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:
Miorel Palii
2014-08-29 14:32:50 -07:00
committed by Paul O’Shannessy
parent 944f49c264
commit 335e91df71
+5 -3
View File
@@ -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);
}
}
}
};