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

Function getTypeForThisExpressionFromJSDoc

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

Source from the content-addressed store, hash-verified

72107 }
72108 }
72109 function getTypeForThisExpressionFromJSDoc(node) {
72110 var jsdocType = ts.getJSDocType(node);
72111 if (jsdocType && jsdocType.kind === 317 /* SyntaxKind.JSDocFunctionType */) {
72112 var jsDocFunctionType = jsdocType;
72113 if (jsDocFunctionType.parameters.length > 0 &&
72114 jsDocFunctionType.parameters[0].name &&
72115 jsDocFunctionType.parameters[0].name.escapedText === "this" /* InternalSymbolName.This */) {
72116 return getTypeFromTypeNode(jsDocFunctionType.parameters[0].type);
72117 }
72118 }
72119 var thisTag = ts.getJSDocThisTag(node);
72120 if (thisTag && thisTag.typeExpression) {
72121 return getTypeFromTypeNode(thisTag.typeExpression);
72122 }
72123 }
72124 function isInConstructorArgumentInitializer(node, constructorDecl) {
72125 return !!ts.findAncestor(node, function (n) { return ts.isFunctionLikeDeclaration(n) ? "quit" : n.kind === 164 /* SyntaxKind.Parameter */ && n.parent === constructorDecl; });
72126 }

Callers 1

tryGetThisTypeAtFunction · 0.85

Calls 1

getTypeFromTypeNodeFunction · 0.85

Tested by

no test coverage detected