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

Method constructor

src/service/xhr-impl.js:29–45  ·  view source on GitHub ↗

* @param {!Window} win

(win)

Source from the content-addressed store, hash-verified

27 * @param {!Window} win
28 */
29 constructor(win) {
30 /** @const {!Window} */
31 this.win = win;
32
33 const ampdocService = Services.ampdocServiceFor(win);
34
35 // The isSingleDoc check is required because if in shadow mode, this will
36 // throw a console error because the shellShadowDoc_ is not set when
37 // fetching the amp doc. So either the test-bind-impl or test pre setup in
38 // shadow mode tests needs to be fixed or there is a bug in ampdoc impl
39 // getAmpDoc.
40 // TODO(alabiaga): This should be investigated and fixed
41 /** @private {?./ampdoc-impl.AmpDoc} */
42 this.ampdocSingle_ = ampdocService.isSingleDoc()
43 ? ampdocService.getSingleDoc()
44 : null;
45 }
46
47 /**
48 * We want to call `fetch_` unbound from any context since it could

Callers

nothing calls this directly

Calls 2

getSingleDocMethod · 0.80
isSingleDocMethod · 0.45

Tested by

no test coverage detected