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

Function createMissingNode

test/fixtures/snapshot/typescript.js:32337–32352  ·  view source on GitHub ↗
(kind, reportAtCurrentPosition, diagnosticMessage, arg0)

Source from the content-addressed store, hash-verified

32335 return node;
32336 }
32337 function createMissingNode(kind, reportAtCurrentPosition, diagnosticMessage, arg0) {
32338 if (reportAtCurrentPosition) {
32339 parseErrorAtPosition(scanner.getStartPos(), 0, diagnosticMessage, arg0);
32340 }
32341 else if (diagnosticMessage) {
32342 parseErrorAtCurrentToken(diagnosticMessage, arg0);
32343 }
32344 var pos = getNodePos();
32345 var result = kind === 79 /* SyntaxKind.Identifier */ ? factory.createIdentifier("", /*typeArguments*/ undefined, /*originalKeywordKind*/ undefined) :
32346 ts.isTemplateLiteralKind(kind) ? factory.createTemplateLiteralLikeNode(kind, "", "", /*templateFlags*/ undefined) :
32347 kind === 8 /* SyntaxKind.NumericLiteral */ ? factory.createNumericLiteral("", /*numericLiteralFlags*/ undefined) :
32348 kind === 10 /* SyntaxKind.StringLiteral */ ? factory.createStringLiteral("", /*isSingleQuote*/ undefined) :
32349 kind === 276 /* SyntaxKind.MissingDeclaration */ ? factory.createMissingDeclaration() :
32350 factory.createToken(kind);
32351 return finishNode(result, pos);
32352 }
32353 function internIdentifier(text) {
32354 var identifier = identifiers.get(text);
32355 if (identifier === undefined) {

Callers 11

parseExpectedTokenFunction · 0.85
parseExpectedTokenJSDocFunction · 0.85
createIdentifierFunction · 0.85
parseRightSideOfDotFunction · 0.85
parseCallExpressionRestFunction · 0.85
parseDeclarationWorkerFunction · 0.85
parseClassElementFunction · 0.85
parseJSDocIdentifierNameFunction · 0.85

Calls 4

parseErrorAtPositionFunction · 0.85
parseErrorAtCurrentTokenFunction · 0.85
getNodePosFunction · 0.85
finishNodeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…