MCPcopy Create free account
hub / github.com/microsoft/typescript-go / parseCatchClause

Method parseCatchClause

internal/parser/parser.go:1497–1508  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1495}
1496
1497func (p *Parser) parseCatchClause() *ast.Node {
1498 pos := p.nodePos()
1499 p.parseExpected(ast.KindCatchKeyword)
1500 var variableDeclaration *ast.Node
1501 if p.parseOptional(ast.KindOpenParenToken) {
1502 variableDeclaration = p.parseVariableDeclaration()
1503 p.parseExpected(ast.KindCloseParenToken)
1504 }
1505 block := p.parseBlock(false /*ignoreMissingOpenBrace*/, nil)
1506 result := p.finishNode(p.factory.NewCatchClause(variableDeclaration, block), pos)
1507 return result
1508}
1509
1510func (p *Parser) parseDebuggerStatement() *ast.Node {
1511 pos := p.nodePos()

Callers 1

parseTryStatementMethod · 0.95

Calls 7

nodePosMethod · 0.95
parseExpectedMethod · 0.95
parseOptionalMethod · 0.95
parseBlockMethod · 0.95
finishNodeMethod · 0.95
NewCatchClauseMethod · 0.80

Tested by

no test coverage detected