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

Function checkGrammarConstructorTypeParameters

test/fixtures/snapshot/typescript.js:88930–88937  ·  view source on GitHub ↗
(node)

Source from the content-addressed store, hash-verified

88928 return false;
88929 }
88930 function checkGrammarConstructorTypeParameters(node) {
88931 var jsdocTypeParameters = ts.isInJSFile(node) ? ts.getJSDocTypeParameterDeclarations(node) : undefined;
88932 var range = node.typeParameters || jsdocTypeParameters && ts.firstOrUndefined(jsdocTypeParameters);
88933 if (range) {
88934 var pos = range.pos === range.end ? range.pos : ts.skipTrivia(ts.getSourceFileOfNode(node).text, range.pos);
88935 return grammarErrorAtPos(node, pos, range.end - pos, ts.Diagnostics.Type_parameters_cannot_appear_on_a_constructor_declaration);
88936 }
88937 }
88938 function checkGrammarConstructorTypeAnnotation(node) {
88939 var type = ts.getEffectiveReturnTypeNode(node);
88940 if (type) {

Callers 1

Calls 1

grammarErrorAtPosFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…