(condition)
| 276 | * Find the ancestor with matches this condition |
| 277 | */ |
| 278 | ancestorNode(condition) { |
| 279 | let node = this; |
| 280 | |
| 281 | while (node.hasParent()) { |
| 282 | node = node.parent(); |
| 283 | if (condition(node)) { |
| 284 | return node; |
| 285 | } |
| 286 | } |
| 287 | |
| 288 | return null; |
| 289 | } |
| 290 | |
| 291 | /** |
| 292 | * Given a condition returns true if the current node |
no test coverage detected