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

Function typeHasArrowFunctionBlockingParseError

internal/parser/parser.go:4456–4466  ·  view source on GitHub ↗

If true, we should abort parsing an error function.

(node *ast.TypeNode)

Source from the content-addressed store, hash-verified

4454
4455// If true, we should abort parsing an error function.
4456func typeHasArrowFunctionBlockingParseError(node *ast.TypeNode) bool {
4457 switch node.Kind {
4458 case ast.KindTypeReference:
4459 return ast.NodeIsMissing(node.AsTypeReferenceNode().TypeName)
4460 case ast.KindFunctionType, ast.KindConstructorType:
4461 return isMissingNodeList(node.FunctionLikeData().Parameters) || typeHasArrowFunctionBlockingParseError(node.Type())
4462 case ast.KindParenthesizedType:
4463 return typeHasArrowFunctionBlockingParseError(node.Type())
4464 }
4465 return false
4466}
4467
4468func (p *Parser) parseArrowFunctionExpressionBody(isAsync bool, allowReturnTypeInArrowFunction bool) *ast.Node {
4469 if p.token == ast.KindOpenBraceToken {

Calls 5

NodeIsMissingFunction · 0.92
isMissingNodeListFunction · 0.85
AsTypeReferenceNodeMethod · 0.80
FunctionLikeDataMethod · 0.65
TypeMethod · 0.45

Tested by

no test coverage detected