Merge pull request #3414 from spicyj/gh-3407

Fix up Perf a bit better for 0.13
(cherry picked from commit 0a312bba89)
This commit is contained in:
Ben Alpert
2015-03-16 14:04:28 -07:00
committed by Paul O’Shannessy
parent 2e72fd8e43
commit a82e70ed34
+7 -5
View File
@@ -163,8 +163,8 @@ var ReactDefaultPerf = {
ReactDefaultPerf._allMeasurements.length - 1
].totalTime = performanceNow() - start;
return rv;
} else if (moduleName === 'ReactDOMIDOperations' ||
moduleName === 'ReactComponentBrowserEnvironment') {
} else if (fnName === '_mountImageIntoNode' ||
moduleName === 'ReactDOMIDOperations') {
start = performanceNow();
rv = func.apply(this, args);
totalTime = performanceNow() - start;
@@ -210,6 +210,10 @@ var ReactDefaultPerf = {
fnName === 'updateComponent' || // TODO: receiveComponent()?
fnName === '_renderValidatedComponent')) {
if (typeof this._currentElement.type === 'string') {
return func.apply(this, args);
}
var rootNodeID = fnName === 'mountComponent' ?
args[0] :
this._rootNodeID;
@@ -243,9 +247,7 @@ var ReactDefaultPerf = {
}
entry.displayNames[rootNodeID] = {
current: typeof this._currentElement.type === 'string' ?
this._currentElement.type :
this.getName(),
current: this.getName(),
owner: this._currentElement._owner ?
this._currentElement._owner.getName() :
'<root>'