Method: previousTrigger
Restore the previous state.  If no items are in the previous history
stack, this has no effect.

Returns:
{Object} Item representing state that was restored.  Undefined if no
items are in the previous history stack.
516727
function() {
        var current = this.previousStack.shift();
        var state = this.previousStack.shift();
        if(state != undefined) {
            this.nextStack.unshift(current);
            this.previousStack.unshift(state);
            this.restoring = true;
            this.restore(state);
            this.restoring = false;
            this.onNextChange(this.nextStack[0], this.nextStack.length);
            this.onPreviousChange(
                this.previousStack[1], this.previousStack.length - 1
            );
        } else {
            this.previousStack.unshift(current);
        }
        return state;
    }
604915
function previously(currentValue, partial) {
    var previous = {};
    Object.keys(partial).forEach(function(key) {
        if (isObject(currentValue[key] && partial[key])) {
            previous[key] = previously(currentValue[key], partial[key]);
        } else {
            previous[key] = currentValue[key];
        }
    });
    return previous;
}
1211794
def OnBackView(self, event):
        """"""
        self.historyIndex -= 1
        try:
            self.RestoreHistory(self.history[self.historyIndex])
        except IndexError, err:
            self.SetStatusText(_('No further history available'))
1161449
function(){
    return {
      current : 0,
      transitionStep: true,
      resumeJoyride: function(){},
      start: false,
      config: {
        overlay: true,
        template: false,
        steps : [],
        onStepChange: function(){},
        onFinish: function(){},
        onStart: function(){}
      },
      next: function(){
        this.transitionStep = 'next';
      },
      prev: function(){
        this.transitionStep = 'prev';
      },
      goTo: function(step){
        this.start = true;
        if (step) {
          this.current = step;
        }
      }
    };
  }
1252645
function() {
			// Stack for all the undo and redo snapshots, they're always created/removed
			// in consistency.
			this.snapshots = [];

			// Current snapshot history index.
			this.index = -1;

			this.currentImage = null;

			this.hasUndo = false;
			this.hasRedo = false;
			this.locked = null;

			this.resetType();
		}
946207
function initHistoryStateStack () {
  // 如果当前tab有历史条目，那么应该把之前存储的state list读取出来
  if (window.history.length > 1) {
    try {
      let historyState = JSON.parse(window.localStorage.getItem(MIP_HISTORY_STATE_STACK_LOCAL_KEY))
      if (historyState && historyState.length) {
        // 为了有效控制localStorage大小，每次读取时应该只读取不大于当前tab历史条目长度
        // 因为大于历史条目长度之前的记录都是过期的state，无需读取
        HISTORY_STATE_STACK = historyState.slice(-window.history.length)
      }
    } catch (err) {

    }
  }

  setTimeout(() => {
    // 首次访问的页面也要加入列表中，但要注意如果当前页面访问过（刷新）则应该替换
    if (HISTORY_STATE_STACK.length) {
      HISTORY_STATE_STACK[HISTORY_STATE_STACK.length - 1] = getHistoryStateKey()
    } else {
      HISTORY_STATE_STACK.push(getHistoryStateKey())
    }
  }, 300)
}
109987
function() {
      var state = this.bt.current_state();

      for(var i=0,len=arguments.length; i<len; i++) {        
        try { 
          return arguments[i].call(this)
        } catch (f) { 
          this.bt.catch_mismatch(f);
          this.bt.restore(state);
        }
      }
      this.bt.mismatch("All alternatives failed");
    }
815876
function(stack) {
    if (exports.async_trace_limit <= 0) {
        return;
    }

    var count = exports.async_trace_limit - 1;
    var previous = stack;

    while (previous && count > 1) {
        previous = previous.__previous__;
        --count;
    }

    if (previous) {
        delete previous.__previous__;
    }
}
1027197
def _handle_backward_execution_before_child_execution(self):
        
        self.backward_execution = True
        last_history_item = self.execution_history.pop_last_item()
        if last_history_item.state_reference is self:
            # if the the next child_state in the history is self exit this hierarchy-state
            if self.child_state:
                # do not set the last state to inactive before executing the new one
                self.child_state.state_execution_status = StateExecutionStatus.INACTIVE
            return True
        assert isinstance(last_history_item, ReturnItem)
        self.scoped_data = last_history_item.scoped_data
        self.child_state = last_history_item.state_reference
        return False
1093063
def history_backward(self, count=1):
        
        self._set_history_search()

        # Go back in history.
        found_something = False

        for i in range(self.working_index - 1, -1, -1):
            if self._history_matches(i):
                self.working_index = i
                count -= 1
                found_something = True
            if count == 0:
                break

        # If we move to another entry, move cursor to the end of the line.
        if found_something:
            self.cursor_position = len(self.text)
322641
def previous(self):
        
        if self._order_by == 'oldest':
            return self.older
        if self._order_by == 'newest':
            return self.newer
        return None
1041373
function(){

    var routes = this.current ? (this.current.data.routes || {}) : {};
        routes[this._previousRoute] = '';

    // Unset Previous Application's Routes. For each route in the page app, remove
    // the handler from our route object and delete our referance to the route's callback
    _.each(routes, (value, key) => {
      var regExp = this._routeToRegExp(key).toString();
      Backbone.history.handlers = _.filter(Backbone.history.handlers, function(obj){
        return obj.route.toString() !== regExp;
      });
    });

    if(!this.current){ return void 0; }

    var oldPageName = this.current.__pageId;

    // Un-hook Event Bindings, Delete Objects
    this.current.data.deinitialize();

    // Now we no longer have a page installed.
    this.current = undefined;

    // Disable old css if it exists
    setTimeout(() => {
      if(this.status === ERROR){ return void 0; }
      document.getElementById(oldPageName + '-css').setAttribute('disabled', true);
    }, 500);

  }
831439
function (name) {
        var ctx = this.getMoreartyContext();
        return getBinding(this.props, name).withBackingValue(ctx._previousState).get();
      }
1242248
function trackSelectedItem(element) {

  const items = element.items;
  const itemCount = items ? items.length : 0;

  const previousSelectedItem = element.selectedItem;
  if (!previousSelectedItem) {
    // No item was previously selected.
    if (element.selectionRequired) {
      // Select the first item by default.
      element.selectedIndex = 0;
    }
  } else if (itemCount === 0) {
    // We've lost the selection, and there's nothing left to select.
    element.selectedItem = null;
  } else {
    // Try to find the previously-selected item in the current set of items.
    const indexInCurrentItems = Array.prototype.indexOf.call(items, previousSelectedItem);
    const previousSelectedIndex = element.selectedIndex;
    if (indexInCurrentItems < 0) {
      // Previously-selected item was removed from the items.
      // Select the item at the same index (if it exists) or as close as possible.
      const newSelectedIndex = Math.min(previousSelectedIndex, itemCount - 1);
      // Select by item, since index may be the same, and we want to raise the
      // selected-item-changed event.
      element.selectedItem = items[newSelectedIndex];
    } else if (indexInCurrentItems !== previousSelectedIndex) {
      // Previously-selected item still there, but changed position.
      element.selectedIndex = indexInCurrentItems;
    }
  }
}
730242
def previous_obj(self):
        
        previous_obj = None
        if self.previous_visit:
            try:
                previous_obj = self.model.objects.get(
                    **{f"{self.model.visit_model_attr()}": self.previous_visit}
                )
            except ObjectDoesNotExist:
                pass
        return previous_obj
1099272
def get_prev_status_from_history(instance, status=None):
    
    target = status or api.get_workflow_status_of(instance)
    history = getReviewHistory(instance, reverse=True)
    history = map(lambda event: event["review_state"], history)
    if target not in history or history.index(target) == len(history)-1:
        return None
    return history[history.index(target)+1]
437385
function (binding) {
    var historyBinding = getHistoryBinding(binding);
    var undo = historyBinding.get('undo');
    return !!undo && !undo.isEmpty();
  }