MCPcopy Create free account
hub / github.com/ampproject/amphtml / constructor

Method constructor

testing/fake-dom.js:531–548  ·  view source on GitHub ↗

@param {!FakeWindow} win

(win)

Source from the content-addressed store, hash-verified

529export class FakeHistory {
530 /** @param {!FakeWindow} win */
531 constructor(win) {
532 /** @const */
533 this.win = win;
534
535 /** @const {!Array<!{url: string}>} */
536 this.stack = [{url: '', state: null}];
537
538 /** @const {number} */
539 this.index = 0;
540
541 Object.defineProperty(this, 'length', {
542 get: () => this.stack.length,
543 });
544
545 Object.defineProperty(this, 'state', {
546 get: () => this.stack[this.index].state,
547 });
548 }
549
550 /** */
551 back() {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected