Allow empty components in the native operation logs

Fixes #6742
This commit is contained in:
Dan Abramov
2016-05-11 23:31:50 +01:00
parent c8a7988bf9
commit 0cd1d3b5a2
+7 -1
View File
@@ -236,11 +236,17 @@ function getWasted(flushHistory = getFlushHistory()) {
function getOperations(flushHistory = getFlushHistory()) {
var stats = [];
flushHistory.forEach((flush, flushIndex) => {
var {operations, treeSnapshot} = flush;
operations.forEach(operation => {
var {instanceID, type, payload} = operation;
var {displayName, ownerID} = treeSnapshot[instanceID];
var {displayName, ownerID} = instanceID !== 0 ?
treeSnapshot[instanceID] :
// Empty components may appear in some operation logs.
{displayName: '#empty', ownerID: null};
var owner = treeSnapshot[ownerID];
var key = (owner ? owner.displayName + ' > ' : '') + displayName;