@samitouri / QOS-React-2 / commits / de54d84051

Repair ReactDefaultPerf

Update ReactDefaultPerf to properly record component names.

Isaac Salier-Hellendag committed Jan 21, 2015 at 10:52 UTC de54d84051682fcdb67b2470cf082c0373c449f0
1 file changed +10 -2
src/test/ReactDefaultPerf.js
+10 -2
@@ -242,10 +242,18 @@ 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 +
252 entry.displayNames[rootNodeID] = {
246 - current: this.constructor.displayName,
253 + current: displayName,
254 owner: this._currentElement._owner ?
248 - this._currentElement._owner.constructor.displayName : '<root>'
255 + this._currentElement._owner._instance.constructor.displayName :
256 + '<root>'
257 };
258
259 return rv;