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

Function installForChildWin

src/polyfills/intersection-observer.js:30–41  ·  view source on GitHub ↗
(parentWin, childWin)

Source from the content-addressed store, hash-verified

28 * @param {!Window} childWin
29 */
30export function installForChildWin(parentWin, childWin) {
31 if (shouldLoadPolyfill(childWin)) {
32 Object.defineProperties(childWin, {
33 IntersectionObserver: {get: () => parentWin.IntersectionObserver},
34 IntersectionObserverEntry: {
35 get: () => parentWin.IntersectionObserverEntry,
36 },
37 });
38 } else {
39 fixEntry(childWin);
40 }
41}
42
43/** @param {!Window} win */
44function fixEntry(win) {

Callers 1

Calls 2

shouldLoadPolyfillFunction · 0.90
fixEntryFunction · 0.85

Tested by

no test coverage detected