MCPcopy Index your code
hub / github.com/ampproject/amphtml / getSingleDoc

Method getSingleDoc

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

* Returns the document in the single-doc mode. In a multi-doc mode, an * error will be thrown. * @return {!AmpDoc}

()

Source from the content-addressed store, hash-verified

98 * @return {!AmpDoc}
99 */
100 getSingleDoc() {
101 // TODO(#22733): once docroot migration is done, this should be renamed
102 // to `getTopDoc()` method.
103 return devAssert(this.singleDoc_);
104 }
105
106 /**
107 * If the node is an AMP custom element, retrieves the AmpDoc reference.

Callers 15

buildCallbackMethod · 0.80
test-extensions.jsFile · 0.80
test-vsync.jsFile · 0.80
test-ampdoc.jsFile · 0.80
test-viewer.jsFile · 0.80
test-runtime.jsFile · 0.80
getFakeWindowFunction · 0.80
test-cid.jsFile · 0.80
test-viewport.jsFile · 0.80
fetchDocumentFunction · 0.80

Calls 1

devAssertFunction · 0.90

Tested by

no test coverage detected