jsdoc template tags might be unmatched (#32936)

* jsdoc template tags might be unmatched

* Update fourslash test
This commit is contained in:
Nathan Shively-Sanders
2019-08-16 13:39:57 -07:00
committed by GitHub
parent 1b46d8fd8f
commit 2b8ccf40ae
2 changed files with 11 additions and 1 deletions

View File

@@ -2343,7 +2343,7 @@ namespace ts {
export function getTypeParameterFromJsDoc(node: TypeParameterDeclaration & { parent: JSDocTemplateTag }): TypeParameterDeclaration | undefined {
const name = node.name.escapedText;
const { typeParameters } = (node.parent.parent.parent as SignatureDeclaration | InterfaceDeclaration | ClassDeclaration);
return find(typeParameters!, p => p.name.escapedText === name);
return typeParameters && find(typeParameters, p => p.name.escapedText === name);
}
export function hasRestParameter(s: SignatureDeclaration | JSDocSignature): boolean {