Merge pull request #3665 from mridgway/replaceHasOwnProperty
[performance] Replace hasOwnProperty in child processing with typeof undefined check
This commit is contained in:
commit
3c66b8f0f7
|
@ -81,7 +81,7 @@ function mapSingleChildIntoContext(traverseContext, child, name, i) {
|
|||
var mapBookKeeping = traverseContext;
|
||||
var mapResult = mapBookKeeping.mapResult;
|
||||
|
||||
var keyUnique = !mapResult.hasOwnProperty(name);
|
||||
var keyUnique = (mapResult[name] === undefined);
|
||||
if (__DEV__) {
|
||||
warning(
|
||||
keyUnique,
|
||||
|
|
|
@ -22,7 +22,7 @@ var warning = require('warning');
|
|||
function flattenSingleChildIntoContext(traverseContext, child, name) {
|
||||
// We found a component instance.
|
||||
var result = traverseContext;
|
||||
var keyUnique = !result.hasOwnProperty(name);
|
||||
var keyUnique = (result[name] === undefined);
|
||||
if (__DEV__) {
|
||||
warning(
|
||||
keyUnique,
|
||||
|
|
Loading…
Reference in New Issue