@samitouri / QOS-React-2 / commits / 5a431a12ac

Replace hasOwnProperty in child processing with typeof undefined check

Michael Ridgway committed Apr 13, 2015 at 14:17 UTC 5a431a12ace4a705d50ba087caaf78a6b01ce546
2 files changed +2 -2
src/utils/ReactChildren.js
+1 -1
@@ -81,7 +81,7 @@ function mapSingleChildIntoContext(traverseContext, child, name, i) {
81 var mapBookKeeping = traverseContext;
82 var mapResult = mapBookKeeping.mapResult;
83
84 - var keyUnique = !mapResult.hasOwnProperty(name);
84 + var keyUnique = ('undefined' === typeof mapResult[name]);
85 if (__DEV__) {
86 warning(
87 keyUnique,
src/utils/flattenChildren.js
+1 -1
@@ -22,7 +22,7 @@ var warning = require('warning');
22 function flattenSingleChildIntoContext(traverseContext, child, name) {
23 // We found a component instance.
24 var result = traverseContext;
25 - var keyUnique = !result.hasOwnProperty(name);
25 + var keyUnique = ('undefined' === typeof result[name]);
26 if (__DEV__) {
27 warning(
28 keyUnique,