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

Function isUnambiguouslyStartOfFunctionType

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

Source from the content-addressed store, hash-verified

34216 return false;
34217 }
34218 function isUnambiguouslyStartOfFunctionType() {
34219 nextToken();
34220 if (token() === 21 /* SyntaxKind.CloseParenToken */ || token() === 25 /* SyntaxKind.DotDotDotToken */) {
34221 // ( )
34222 // ( ...
34223 return true;
34224 }
34225 if (skipParameterStart()) {
34226 // We successfully skipped modifiers (if any) and an identifier or binding pattern,
34227 // now see if we have something that indicates a parameter declaration
34228 if (token() === 58 /* SyntaxKind.ColonToken */ || token() === 27 /* SyntaxKind.CommaToken */ ||
34229 token() === 57 /* SyntaxKind.QuestionToken */ || token() === 63 /* SyntaxKind.EqualsToken */) {
34230 // ( xxx :
34231 // ( xxx ,
34232 // ( xxx ?
34233 // ( xxx =
34234 return true;
34235 }
34236 if (token() === 21 /* SyntaxKind.CloseParenToken */) {
34237 nextToken();
34238 if (token() === 38 /* SyntaxKind.EqualsGreaterThanToken */) {
34239 // ( xxx ) =>
34240 return true;
34241 }
34242 }
34243 }
34244 return false;
34245 }
34246 function parseTypeOrTypePredicate() {
34247 var pos = getNodePos();
34248 var typePredicateVariable = isIdentifier() && tryParse(parseTypePredicatePrefix);

Callers

nothing calls this directly

Calls 3

nextTokenFunction · 0.85
skipParameterStartFunction · 0.85
tokenFunction · 0.70

Tested by

no test coverage detected