From 5c239fa64cbda1c30ee531dec1fbf53d33ffd96a Mon Sep 17 00:00:00 2001 From: Andy Date: Tue, 26 Sep 2017 12:52:35 -0700 Subject: [PATCH] Remove redundant handler for JSDocComment in `checkSourceElement` (#18771) --- src/compiler/checker.ts | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 18232280730..d89247b70f9 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -19789,14 +19789,6 @@ namespace ts { } } - function checkJSDocComment(node: JSDoc) { - if ((node as JSDoc).tags) { - for (const tag of (node as JSDoc).tags) { - checkSourceElement(tag); - } - } - } - function checkFunctionOrMethodDeclaration(node: FunctionDeclaration | MethodDeclaration): void { checkDecorators(node); checkSignatureDeclaration(node); @@ -22432,8 +22424,8 @@ namespace ts { } if (isInJavaScriptFile(node) && (node as JSDocContainer).jsDoc) { - for (const jsdoc of (node as JSDocContainer).jsDoc) { - checkJSDocComment(jsdoc); + for (const { tags } of (node as JSDocContainer).jsDoc) { + forEach(tags, checkSourceElement); } } @@ -22493,8 +22485,6 @@ namespace ts { return checkSourceElement((node).type); case SyntaxKind.JSDocTypedefTag: return checkJSDocTypedefTag(node as JSDocTypedefTag); - case SyntaxKind.JSDocComment: - return checkJSDocComment(node as JSDoc); case SyntaxKind.JSDocParameterTag: return checkSourceElement((node as JSDocParameterTag).typeExpression); case SyntaxKind.JSDocFunctionType: