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

Function getNthParentWindow

ads/alp/handler.js:252–258  ·  view source on GitHub ↗

* Returns the Nth parent of the given window. * @param {!Window} win * @param {number} distance frames above us. * @return {!Window}

(win, distance)

Source from the content-addressed store, hash-verified

250 * @return {!Window}
251 */
252function getNthParentWindow(win, distance) {
253 let parent = win;
254 for (let i = 0; i < distance; i++) {
255 parent = parent.parent;
256 }
257 return parent;
258}

Callers 1

getA2AAncestorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected