mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Merge pull request #3665 from mridgway/replaceHasOwnProperty
[performance] Replace hasOwnProperty in child processing with typeof undefined check
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user