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

Function resolveDoc

third_party/subscriptions-project/swg.js:10725–10735  ·  view source on GitHub ↗

* @param {!Document|!Window|!Doc} input * @return {!Doc}

(input)

Source from the content-addressed store, hash-verified

10723 * @return {!Doc}
10724 */
10725function resolveDoc(input) {
10726 // Is it a `Document`
10727 if (/** @type {!Document} */ (input).nodeType === /* DOCUMENT */ 9) {
10728 return new GlobalDoc(/** @type {!Document} */ (input));
10729 }
10730 // Is it a `Window`?
10731 if (/** @type {!Window} */ (input).document) {
10732 return new GlobalDoc(/** @type {!Window} */ (input));
10733 }
10734 return /** @type {!Doc} */ (input);
10735}
10736
10737/**
10738 * Copyright 2018 The Subscribe with Google Authors. All Rights Reserved.

Callers 2

buildIframe_Method · 0.70
constructorMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected