docs: function () {
              if (savedToStatePath) {
                toState.path = savedToStatePath;
                savedToStatePath = null;
              }
  
              if (savedFromStatePath) {
                fromState.path = savedFromStatePath;
                savedFromStatePath = null;
              }
  
              angular.forEach(restore.restoreFunctions, function (restoreFunction) {
                restoreFunction();
              });
              // Restore is done, now set the restore function to noop in case it gets called again.
              restore = noop;
              // pendingRestore keeps track of a transition that is in progress.  It allows the decorated transitionTo
              // method to be re-entrant (for example, when superceding a transition, i.e., redirect).  The decorated
              // transitionTo checks right away if there is a pending transition in progress and restores the paths
              // if so using pendingRestore.
              pendingRestore = null;
              pendingTransitions.splice(idx, 1); // Remove this transition from the list
            }