* Aggregates all throw-statements within this node *without* crossing * into function boundaries and try-blocks with catch-clauses.
(node)
| 135643 | * into function boundaries and try-blocks with catch-clauses. |
| 135644 | */ |
| 135645 | function aggregateOwnedThrowStatements(node) { |
| 135646 | if (ts.isThrowStatement(node)) { |
| 135647 | return [node]; |
| 135648 | } |
| 135649 | else if (ts.isTryStatement(node)) { |
| 135650 | // Exceptions thrown within a try block lacking a catch clause are "owned" in the current context. |
| 135651 | return ts.concatenate(node.catchClause ? aggregateOwnedThrowStatements(node.catchClause) : node.tryBlock && aggregateOwnedThrowStatements(node.tryBlock), node.finallyBlock && aggregateOwnedThrowStatements(node.finallyBlock)); |
| 135652 | } |
| 135653 | // Do not cross function boundaries. |
| 135654 | return ts.isFunctionLike(node) ? undefined : flatMapChildren(node, aggregateOwnedThrowStatements); |
| 135655 | } |
| 135656 | /** |
| 135657 | * For lack of a better name, this function takes a throw statement and returns the |
| 135658 | * nearest ancestor that is a try-block (whose try statement has a catch clause), |
no test coverage detected