Fix Perf displayName with ES6 classes
Toru Kobayashi committed
Mar 9, 2015 at 01:16 UTC
29506cec545689abf632d95648f93c8220ae8cb0
1 file changed
+4
-9
src/test/ReactDefaultPerf.js
+4
-9
@@ -242,17 +242,12 @@ var ReactDefaultPerf = {
242
addValue(entry.inclusive, rootNodeID, totalTime);
243
}
244
245
- var displayName = null;
246
- if (this._instance.constructor.displayName) {
247
- displayName = this._instance.constructor.displayName;
248
- } else if (this._currentElement.type) {
249
- displayName = this._currentElement.type;
250
- }
251
-
245
entry.displayNames[rootNodeID] = {
253
- current: displayName,
246
+ current: typeof this._currentElement.type === 'string' ?
247
+ this._currentElement.type :
248
+ this.getName(),
249
owner: this._currentElement._owner ?
255
- this._currentElement._owner._instance.constructor.displayName :
250
+ this._currentElement._owner.getName() :
251
'<root>'
252
};
253