src/debug/registry_wrapper.js
function getTrackableFunction(obj, name, trackedFunctions) {
  var debugName = obj.getDebugName();
  var originalFn = obj[name];
  var fnName = `${debugName}.${name}`;
  var instrumentedFn = instrumentFunction(fnName, originalFn);
  var fn = function tungstenTrackingPassthrough() {
    // Since objects are passed by reference, it can be updated without loosing reference
    if (trackedFunctions[name]) {
      return instrumentedFn.apply(this, arguments);
    } else {
      return originalFn.apply(this, arguments);
    }
  };
  fn.original = originalFn;
  return fn;
}
function getTrackableFunction(obj, name, trackedFunctions) {
  var debugName = obj.getDebugName();
  var originalFn = obj[name];
  var fnName = `${debugName}.${name}`;
  var instrumentedFn = instrumentFunction(fnName, originalFn);
  var fn = function tungstenTrackingPassthrough() {
    // Since objects are passed by reference, it can be updated without loosing reference
    if (trackedFunctions[name]) {
      return instrumentedFn.apply(this, arguments);
    } else {
      return originalFn.apply(this, arguments);
    }
  };
  fn.original = originalFn;
  return fn;
}
function getTrackableFunction ( obj , name , trackedFunctions ) { var debugName = obj . getDebugName ( ) ; var originalFn = obj [ name ] ; var fnName = ` ${ debugName } ${ name } ` ; var instrumentedFn = instrumentFunction ( fnName , originalFn ) ; var fn = function tungstenTrackingPassthrough ( ) { // Since objects are passed by reference, it can be updated without loosing reference if ( trackedFunctions [ name ] ) { return instrumentedFn . apply ( this , arguments ) ; } else { return originalFn . apply ( this , arguments ) ; } } ; fn . original = originalFn ; return fn ; }
Returns a passthrough function wrapping the passed in one

@param  {Object}   obj              Class to override function for
@param  {string}   name             Name of the function to override
@param  {Object}   trackedFunctions Object that maps which functions are currently tracked

@return {Function}                  Passthrough function
Returns a passthrough function wrapping the passed in one