* Calculate the hostWindow * @private * @return {!Window}
()
| 386 | * @return {!Window} |
| 387 | */ |
| 388 | getHostWindow_() { |
| 389 | const sentinelMatch = this.sentinel.match(/((\d+)-\d+)/); |
| 390 | devAssert(sentinelMatch, 'Incorrect sentinel format'); |
| 391 | const depth = Number(sentinelMatch[2]); |
| 392 | const ancestors = []; |
| 393 | for (let win = this.win_; win && win != win.parent; win = win.parent) { |
| 394 | // Add window keeping the top-most one at the front. |
| 395 | ancestors.push(win.parent); |
| 396 | } |
| 397 | return ancestors[ancestors.length - 1 - depth]; |
| 398 | } |
| 399 | |
| 400 | /** |
| 401 | * Checks to see if there is a window variable assigned with the |
no test coverage detected