Repair ReactDefaultPerf

Update ReactDefaultPerf to properly record component names.
This commit is contained in:
Isaac Salier-Hellendag
2015-01-21 10:52:43 -06:00
parent ce5346f2ce
commit de54d84051
+10 -2
View File
@@ -242,10 +242,18 @@ var ReactDefaultPerf = {
addValue(entry.inclusive, rootNodeID, totalTime);
}
var displayName = null;
if (this._instance.constructor.displayName) {
displayName = this._instance.constructor.displayName;
} else if (this._currentElement.type) {
displayName = this._currentElement.type;
}
entry.displayNames[rootNodeID] = {
current: this.constructor.displayName,
current: displayName,
owner: this._currentElement._owner ?
this._currentElement._owner.constructor.displayName : '<root>'
this._currentElement._owner._instance.constructor.displayName :
'<root>'
};
return rv;