getJSDocHost always returns a defined result (#24255)
This commit is contained in:
parent
d60866aada
commit
7f0258bcb9
|
@ -2172,8 +2172,7 @@ namespace ts {
|
|||
return;
|
||||
}
|
||||
const host = getJSDocHost(node);
|
||||
if (host &&
|
||||
isExpressionStatement(host) &&
|
||||
if (isExpressionStatement(host) &&
|
||||
isBinaryExpression(host.expression) &&
|
||||
getSpecialPropertyAssignmentKind(host.expression) === SpecialPropertyAssignmentKind.PrototypeProperty) {
|
||||
const symbol = getSymbolOfNode(host.expression.left);
|
||||
|
|
|
@ -1927,11 +1927,7 @@ namespace ts {
|
|||
}
|
||||
|
||||
export function getJSDocHost(node: Node): HasJSDoc {
|
||||
const comment = findAncestor(node.parent,
|
||||
node => !(isJSDocNode(node) || node.flags & NodeFlags.JSDoc) ? "quit" : node.kind === SyntaxKind.JSDocComment);
|
||||
if (comment) {
|
||||
return (comment as JSDoc).parent;
|
||||
}
|
||||
return Debug.assertDefined(findAncestor(node.parent, isJSDoc)).parent;
|
||||
}
|
||||
|
||||
export function getTypeParameterFromJsDoc(node: TypeParameterDeclaration & { parent: JSDocTemplateTag }): TypeParameterDeclaration | undefined {
|
||||
|
|
Loading…
Reference in a new issue