Throws an error if object shape is not that of a history object.

@param  {History} history
511918
function assertHistoryType (history) {
  assertType("history", "object", history);
  assertType("history.listen", "function", history.listen);
  assertType("history.push", "function", history.push);
  assertType("history.replace", "function", history.replace);
  assertType("history.goBack", "function", history.goBack);
}
826291
function (fragment, createHistoryEntry, triggerRoute, force, callback) {

            var self = this;

            if (!callback && createHistoryEntry instanceof Function) {
                callback = createHistoryEntry;
                createHistoryEntry = null;
            }

            if (!callback && triggerRoute instanceof Function) {
                callback = triggerRoute;
                triggerRoute = null;
            }

            if (!callback && force instanceof Function) {
                callback = force;
                force = null;
            }

            if (createHistoryEntry == undefined || createHistoryEntry === null) {
                createHistoryEntry = true;
            }

            if (triggerRoute == undefined || triggerRoute === null) {
                triggerRoute = true;
            }

            var eventData = {
                fragment: fragment,
                createHistoryEntry: createHistoryEntry,
                triggerRoute: triggerRoute
            };

            var urlChange = this._getFragment() !== fragment;

            if (!urlChange && !force) {
                callback && callback();
                return;
            }

            this.trigger(History.EVENTS.NAVIGATION_START, eventData);
            this.$processUrl = urlChange;

            if (createHistoryEntry) {
                if (this.runsInBrowser()) {
                    if (this.$.useState) {

                        console.log("Pushing " + fragment + " to history");

                        window.history.pushState({
                            fragment: "/" + fragment
                        }, null, this.$.baseUrl + fragment);
                    } else {
                        window.location.hash = "/" + encodeURI(fragment);
                    }
                } else {
                    this.checkUrl(null);
                }
                this.$history.push(fragment);
            } else {
                if (this.runsInBrowser()) {

                    if (this.$.useState) {

                        console.log("Replacing " + fragment + " to history");

                        window.history.replaceState({
                            fragment: "/" + fragment
                        }, null, this.$.baseUrl + fragment);
                    } else {
                        // replace hash
                        window.location.replace("#/" + fragment);
                    }
                }
                this.$history[this.$history.length - 1] = fragment;
            }

            this.$processUrl = true;

            if(this.$fragment !== fragment){
                this.$fragment = fragment;
                this.trigger('change:fragment', this.$fragment);
            }

            if (triggerRoute) {
                this.triggerRoute(fragment, function() {
                    self.trigger(History.EVENTS.NAVIGATION_COMPLETE, eventData);
                    if (callback) {
                        callback.apply(self, arguments);
                    }
                });
            } else {
                this.trigger(History.EVENTS.NAVIGATION_COMPLETE, eventData);
            }
        }
525114
protected void setHistoryEnabled (boolean historyEnabled)
    {
        if (historyEnabled && _historyModel == null) {
            _historyModel = _scrollbar.getModel();
            _historyModel.addChangeListener(this);
            resetHistoryOffset();

            // out with the subtitles, we'll be displaying history
            clearGlyphs(_subtitles);

            // "scroll" down to the latest history entry
            updateHistBar(_history.size() - 1);

            // refigure our history
            figureCurrentHistory();

        } else if (!historyEnabled && _historyModel != null) {
            _historyModel.removeChangeListener(this);
            _historyModel = null;

            // out with the history, we'll be displaying subtitles
            clearGlyphs(_showingHistory);
        }
    }
921232
protected boolean isHistoryEventProduced(HistoryEventType eventType, Job job) {
    ProcessEngineConfigurationImpl configuration = Context.getProcessEngineConfiguration();
    HistoryLevel historyLevel = configuration.getHistoryLevel();
    return historyLevel.isHistoryEventProduced(eventType, job);
  }
668074
function dumpHistory(history, size, depth) {
    console.log("Hash table history, size="+size+", average depth="+depth);
    for (var n=0; n < history.length; n++) {
        console.log("  Depth=" + n + ", count=" + history[n] + ", percent=" + (history[n] / size));
    }
    console.log("");
}
1124808
public void replaceHistory(@NonNull final Object key, @NonNull final Direction direction) {
    setHistory(getHistory().buildUpon().clear().push(key).build(), direction);
  }
437385
function (binding) {
    var historyBinding = getHistoryBinding(binding);
    var undo = historyBinding.get('undo');
    return !!undo && !undo.isEmpty();
  }
260490
function (module) {

            var moduleObj;

            if (typeof module !== "string") {
                throw new Error("Missing or invalid argument");
            }

            if (!_initialized) {
                throw new Error("The Browser History Manager is not initialized");
            }

            moduleObj = _modules[module];
            if (!moduleObj) {
                throw new Error("No such registered module: " + module);
            }

            return unescape(moduleObj.currentState);
        }
483985
def write_history(self, history):
        
        self._FITS.write_history(self._ext+1, str(history))
974903
function createDefaultHandler (history) {
  return function (context, runMiddleware) {
    runMiddleware(context, function (err, redirect) {
      if (err) {
        console.error(`${context.uri} -> ${err.message}`, err);
      } else if (redirect) {
        history.replace(redirect);
      }
    });
  }
}
946919
function(element,eventName,callback){
			// Prepare
			var uid = history.Adapter.uid(element);

			// Apply Listener
			history.Adapter.handlers[uid] = history.Adapter.handlers[uid] || {};
			history.Adapter.handlers[uid][eventName] = history.Adapter.handlers[uid][eventName] || [];
			history.Adapter.handlers[uid][eventName].push(callback);

			// Bind Global Listener
			element['on'+eventName] = (function(element,eventName){
				return function(event){
					history.Adapter.trigger(element,eventName,event);
				};
			})(element,eventName);
		}
266507
private void pruneExcessiveHistoricalRecordsLocked() {
        List<HistoricalRecord> choiceRecords = mHistoricalRecords;
        final int pruneCount = choiceRecords.size() - mHistoryMaxSize;
        if (pruneCount <= 0) {
            return;
        }
        mHistoricalRecordsChanged = true;
        for (int i = 0; i < pruneCount; i++) {
            HistoricalRecord prunedRecord = choiceRecords.remove(0);
            if (DEBUG) {
                Log.i(LOG_TAG, "Pruned: " + prunedRecord);
            }
        }
    }
447280
function(historyinfo){
		this.allerase();
		
		this.initpos = this.position = historyinfo.current || 0;
		this.history = [];
		var datas = historyinfo.datas || [];
		for(var i=0,len=datas.length;i <len;i++){
			var opelist = new this.klass.OperationList();
			this.history.push(opelist);
			var array = datas[i];
			if(array.time!==void 0){
				opelist.time = array.time;
				array = array.ope;
			}
			for(var j=0,len2=array.length;j <len2;j++){
				var strs = array[j].split(/,/);
				var ope = null, List = this.operationlist;
				for(var k=0;k <List.length;k++){
					var ope1 = new List[k]();
					if(ope1.decode(strs)){ ope = ope1; break;}
				}
				if(!!ope){
					opelist.push(ope);
					this.lastope = ope;
				}
			}
		}
		
		this.checkexec();
		
		this.trialpos = historyinfo.trialpos || [];
		if(this.trialpos.length>0){
			this.resumeTrial();
			this.limitTrialUndo = true;
		}
	}
591584
function insert (history, state, limit, group) {
  debug.log('inserting', state)
  debug.log('new free: ', limit - lengthWithoutFuture(history))

  const { past, _latestUnfiltered } = history
  const historyOverflow = limit && lengthWithoutFuture(history) >= limit

  const pastSliced = past.slice(historyOverflow ? 1 : 0)
  const newPast = _latestUnfiltered != null
    ? [
      ...pastSliced,
      _latestUnfiltered
    ] : pastSliced

  return newHistory(newPast, state, [], group)
}
171509
function(sValue) {
			var aHistory = this._initHistory();
			for (var i = 0; i < aHistory.length; i++) {
				if (aHistory[i] == sValue) {
					aHistory.splice(i, 1);
					break;
				}
			}
		}
827777
private void logOriginalResponseHistory(
        PluginResponse httpServletResponse, History history) throws URIException {
        RequestInformation requestInfo = requestInformation.get();
        if (requestInfo.handle && requestInfo.client.getIsActive()) {
            logger.info("Storing original response history");
            history.setOriginalResponseHeaders(HttpUtilities.getHeaders(httpServletResponse));
            history.setOriginalResponseCode(Integer.toString(httpServletResponse.getStatus()));
            history.setOriginalResponseContentType(httpServletResponse.getContentType());
            history.setOriginalResponseData(httpServletResponse.getContentString());
            logger.info("Done storing");
        }
    }
446196
function (sRoute, oData) {
			var oHistory = History.getInstance();
			var oPrevHash = oHistory.getPreviousHash();
			if (oPrevHash !== undefined) {
				window.history.go(-1);
			} else {
				var bReplace = true; // otherwise we go backwards with a forward history
				this.navTo(sRoute, oData, bReplace);
			}
		}