Skip to content

Commit

Permalink
Fix Perf displayName with ES6 classes
Browse files Browse the repository at this point in the history
  • Loading branch information
koba04 committed Mar 10, 2015
1 parent 62ee384 commit 29506ce
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/test/ReactDefaultPerf.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,17 +242,12 @@ 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: displayName,
current: typeof this._currentElement.type === 'string' ?
this._currentElement.type :
this.getName(),
owner: this._currentElement._owner ?
this._currentElement._owner._instance.constructor.displayName :
this._currentElement._owner.getName() :
'<root>'
};

Expand Down

0 comments on commit 29506ce

Please sign in to comment.