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

Method constructor

src/service/ampdoc-impl.js:71–83  ·  view source on GitHub ↗

* @param {!Window} win * @param {boolean} isSingleDoc * @param {!{[key: string]: string}=} opt_initParams

(win, isSingleDoc, opt_initParams)

Source from the content-addressed store, hash-verified

69 * @param {!{[key: string]: string}=} opt_initParams
70 */
71 constructor(win, isSingleDoc, opt_initParams) {
72 /** @const {!Window} */
73 this.win = win;
74
75 /** @private {?AmpDoc} */
76 this.singleDoc_ = null;
77 if (isSingleDoc) {
78 this.singleDoc_ = new AmpDocSingle(win, {
79 params: extractSingleDocParams(win, opt_initParams),
80 });
81 win.document[AMPDOC_PROP] = this.singleDoc_;
82 }
83 }
84
85 /**
86 * Whether the runtime in the single-doc mode. Alternative is the shadow-doc

Callers

nothing calls this directly

Calls 1

extractSingleDocParamsFunction · 0.85

Tested by

no test coverage detected