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

Make the injection of ReactPerf work

The injection was only evaluated when ReactCompositeComponent was first loaded. This made it impossible to inject a custom measure and the injection pointless.

Jan Kassens committed Oct 9, 2013 at 11:07 UTC c99d6a80135ddd4585d5ac495743605db93d914a
1 file changed +4 -3
src/test/ReactPerf.js
+4 -3
@@ -42,14 +42,15 @@ var ReactPerf = {
42 */
43 measure: function(objName, fnName, func) {
44 if (__DEV__) {
45 - if (this.enableMeasure) {
46 - var measuredFunc = null;
47 - return function() {
45 + var measuredFunc = null;
46 + return function() {
47 + if (ReactPerf.enableMeasure) {
48 if (!measuredFunc) {
49 measuredFunc = ReactPerf.storedMeasure(objName, fnName, func);
50 }
51 return measuredFunc.apply(this, arguments);
52 };
53 + return func.apply(this, arguments);
54 }
55 }
56 return func;