diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 91ce1f1022f..f40237ba47e 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -450,7 +450,7 @@ namespace ts { modifiers?: ModifiersArray; // Array of modifiers /* @internal */ id?: number; // Unique id (used to look up NodeLinks) parent?: Node; // Parent node (initialized by binding - /* @internal */ jsDocComments?: JSDocComment[]; // JSDoc for the node, if it has any. Only for .js files. + /* @internal */ jsDocComments?: JSDocComment[]; // JSDoc for the node, if it has any. Only for .js files. /* @internal */ symbol?: Symbol; // Symbol declared by node (initialized by binding) /* @internal */ locals?: SymbolTable; // Locals associated with node (initialized by binding) /* @internal */ nextContainer?: Node; // Next container in declaration order (initialized by binding) diff --git a/src/services/utilities.ts b/src/services/utilities.ts index 73ac43911b5..0230195b0cc 100644 --- a/src/services/utilities.ts +++ b/src/services/utilities.ts @@ -267,7 +267,7 @@ namespace ts { if (includeJsDocComment) { const jsDocChildren = ts.filter(current.getChildren(), isJSDocNode); for (const jsDocChild of jsDocChildren) { - let start = allowPositionInLeadingTrivia ? jsDocChild.getFullStart() : jsDocChild.getStart(sourceFile, includeJsDocComment); + const start = allowPositionInLeadingTrivia ? jsDocChild.getFullStart() : jsDocChild.getStart(sourceFile, includeJsDocComment); if (start <= position) { let end = jsDocChild.getEnd(); if (position < end || (position === end && jsDocChild.kind === SyntaxKind.EndOfFileToken)) { @@ -500,9 +500,8 @@ namespace ts { } if (node) { - let jsDocComments = node.jsDocComments; - if (jsDocComments) { - for (const jsDocComment of jsDocComments) { + if (node.jsDocComments) { + for (const jsDocComment of node.jsDocComments) { for (const tag of jsDocComment.tags) { if (tag.pos <= position && position <= tag.end) { return tag;