MCPcopy
hub / github.com/jquery/esprima / parseTryStatement

Method parseTryStatement

src/parser.ts:2605–2618  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2603 }
2604
2605 parseTryStatement(): Node.TryStatement {
2606 const node = this.createNode();
2607 this.expectKeyword('try');
2608
2609 const block = this.parseBlock();
2610 const handler = this.matchKeyword('catch') ? this.parseCatchClause() : null;
2611 const finalizer = this.matchKeyword('finally') ? this.parseFinallyClause() : null;
2612
2613 if (!handler && !finalizer) {
2614 this.throwError(Messages.NoCatchOrFinally);
2615 }
2616
2617 return this.finalize(node, new Node.TryStatement(block, handler, finalizer));
2618 }
2619
2620 // https://tc39.github.io/ecma262/#sec-debugger-statement
2621

Callers 1

parseStatementMethod · 0.95

Calls 8

createNodeMethod · 0.95
expectKeywordMethod · 0.95
parseBlockMethod · 0.95
matchKeywordMethod · 0.95
parseCatchClauseMethod · 0.95
parseFinallyClauseMethod · 0.95
throwErrorMethod · 0.95
finalizeMethod · 0.95

Tested by

no test coverage detected