* @param {!Document|!Window|!Doc} input * @return {!Doc}
(input)
| 232 | * @return {!Doc} |
| 233 | */ |
| 234 | function resolveDoc(input) { |
| 235 | // Is it a `Document` |
| 236 | if (/** @type {!Document} */ (input).nodeType === /* DOCUMENT */ 9) { |
| 237 | return new GlobalDoc(/** @type {!Document} */ (input)); |
| 238 | } |
| 239 | // Is it a `Window`? |
| 240 | if (/** @type {!Window} */ (input).document) { |
| 241 | return new GlobalDoc(/** @type {!Window} */ (input)); |
| 242 | } |
| 243 | return /** @type {!Doc} */ (input); |
| 244 | } |
| 245 | |
| 246 | /** |
| 247 | * Copyright 2018 The Subscribe with Google Authors. All Rights Reserved. |