()
| 36044 | } |
| 36045 | // TODO: Review for error recovery |
| 36046 | function parseTryStatement() { |
| 36047 | var pos = getNodePos(); |
| 36048 | var hasJSDoc = hasPrecedingJSDocComment(); |
| 36049 | parseExpected(111 /* SyntaxKind.TryKeyword */); |
| 36050 | var tryBlock = parseBlock(/*ignoreMissingOpenBrace*/ false); |
| 36051 | var catchClause = token() === 83 /* SyntaxKind.CatchKeyword */ ? parseCatchClause() : undefined; |
| 36052 | // If we don't have a catch clause, then we must have a finally clause. Try to parse |
| 36053 | // one out no matter what. |
| 36054 | var finallyBlock; |
| 36055 | if (!catchClause || token() === 96 /* SyntaxKind.FinallyKeyword */) { |
| 36056 | parseExpected(96 /* SyntaxKind.FinallyKeyword */, ts.Diagnostics.catch_or_finally_expected); |
| 36057 | finallyBlock = parseBlock(/*ignoreMissingOpenBrace*/ false); |
| 36058 | } |
| 36059 | return withJSDoc(finishNode(factory.createTryStatement(tryBlock, catchClause, finallyBlock), pos), hasJSDoc); |
| 36060 | } |
| 36061 | function parseCatchClause() { |
| 36062 | var pos = getNodePos(); |
| 36063 | parseExpected(83 /* SyntaxKind.CatchKeyword */); |
no test coverage detected