code: function attachProfiling( scope, watchExp, listener, objectEquality ) {
     const watcherIsFunction = typeof watchExp === 'function';
     const listenerIsFunction = typeof listener === 'function';
  
     const items = axProfiling.items;
     const context = determineContext( scope );
     if( !( scope.$id in items ) ) {
        items[ scope.$id ] = {
           context,
           watchers: []
        };
  
        scope.$on( '$destroy', () => {
           detachProfiling( scope );
           delete items[ scope.$id ];
        } );
     }
  
  
     if( context.widgetScopeId ) {
        if( !( context.widgetId in axProfiling.widgetIdToScopeId ) ) {
           axProfiling.widgetIdToScopeId[ context.widgetId ] = context.widgetScopeId;
        }
     }
  
     const profilingEntry = {
        watchFn: {
           type: watcherIsFunction ? 'f' : 's',
           name: watcherIsFunction ? `${functionName( watchExp )}()` : watchExp,
           time: 0,
           count: 0
        },
        listener: {
           type: listenerIsFunction ? 'f' : 's',
           name: listenerIsFunction ? `${functionName( listener )}()` : listener,
           time: 0,
           count: 0
        }
     };
     items[ scope.$id ].watchers.push( profilingEntry );
  
     const stopWatching = origWatch.call( scope, watchExp, listener, objectEquality );
  
     const watchEntry = scope.$$watchers[ 0 ];
     watchEntry.get = instrumentFunction( watchEntry.get, profilingEntry.watchFn );
     watchEntry.fn = instrumentFunction( watchEntry.fn, profilingEntry.listener );
  
     return () => {
        stopWatching();
        detachProfiling( scope );
     };
  }
docs: ////////////////////////////////////////////////////////////////////////////////////////////////////////////