MCPcopy
hub / github.com/ampproject/amphtml / pushState

Method pushState

testing/fake-dom.js:587–600  ·  view source on GitHub ↗

* @param {?Object} state * @param {?string} title * @param {?string} url * @param {boolean=} opt_fireEvent

(state, title, url, opt_fireEvent)

Source from the content-addressed store, hash-verified

585 * @param {boolean=} opt_fireEvent
586 */
587 pushState(state, title, url, opt_fireEvent) {
588 this.index++;
589 if (this.index < this.stack.length) {
590 // Remove tail.
591 this.stack.splice(this.index, this.stack.length - this.index);
592 }
593 this.stack[this.index] = {
594 state: state ? freeze(state) : null,
595 url,
596 };
597 if (opt_fireEvent) {
598 this.win.eventListeners.fire({type: 'popstate'});
599 }
600 }
601
602 /**
603 * @param {?Object} state

Callers 4

test-errors.jsFile · 0.80
test-history.jsFile · 0.80
navigateToMethod · 0.80
assignMethod · 0.80

Calls 2

freezeFunction · 0.85
fireMethod · 0.45

Tested by

no test coverage detected