MCPcopy Index your code
hub / github.com/nodejs/node / parseFunctionOrConstructorType

Function parseFunctionOrConstructorType

test/fixtures/snapshot/typescript.js:33876–33890  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

33874 return modifiers;
33875 }
33876 function parseFunctionOrConstructorType() {
33877 var pos = getNodePos();
33878 var hasJSDoc = hasPrecedingJSDocComment();
33879 var modifiers = parseModifiersForConstructorType();
33880 var isConstructorType = parseOptional(103 /* SyntaxKind.NewKeyword */);
33881 var typeParameters = parseTypeParameters();
33882 var parameters = parseParameters(4 /* SignatureFlags.Type */);
33883 var type = parseReturnType(38 /* SyntaxKind.EqualsGreaterThanToken */, /*isType*/ false);
33884 var node = isConstructorType
33885 ? factory.createConstructorTypeNode(modifiers, typeParameters, parameters, type)
33886 : factory.createFunctionTypeNode(typeParameters, parameters, type);
33887 if (!isConstructorType)
33888 node.modifiers = modifiers;
33889 return withJSDoc(finishNode(node, pos), hasJSDoc);
33890 }
33891 function parseKeywordAndNoDot() {
33892 var node = parseTokenNode();
33893 return token() === 24 /* SyntaxKind.DotToken */ ? undefined : node;

Callers 2

parseTypeFunction · 0.85

Calls 9

getNodePosFunction · 0.85
hasPrecedingJSDocCommentFunction · 0.85
parseOptionalFunction · 0.85
parseTypeParametersFunction · 0.85
parseParametersFunction · 0.85
parseReturnTypeFunction · 0.85
withJSDocFunction · 0.85
finishNodeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…