Skip to content

Commit 62e5541

Browse files
author
Andy
authored
parseJSDocCommentWorker: Don't need result (microsoft#25197)
1 parent 8923a01 commit 62e5541

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

src/compiler/parser.ts

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6334,19 +6334,18 @@ namespace ts {
63346334
Debug.assert(start <= end);
63356335
Debug.assert(end <= content.length);
63366336

6337+
// Check for /** (JSDoc opening part)
6338+
if (!isJSDocLikeText(content, start)) {
6339+
return undefined;
6340+
}
6341+
63376342
let tags: JSDocTag[];
63386343
let tagsPos: number;
63396344
let tagsEnd: number;
63406345
const comments: string[] = [];
6341-
let result: JSDoc | undefined;
6342-
6343-
// Check for /** (JSDoc opening part)
6344-
if (!isJSDocLikeText(content, start)) {
6345-
return result;
6346-
}
63476346

63486347
// + 3 for leading /**, - 5 in total for /** */
6349-
scanner.scanRange(start + 3, length - 5, () => {
6348+
return scanner.scanRange(start + 3, length - 5, () => {
63506349
// Initially we can parse out a tag. We also have seen a starting asterisk.
63516350
// This is so that /** * @type */ doesn't parse.
63526351
let state = JSDocState.SawAsterisk;
@@ -6432,11 +6431,9 @@ namespace ts {
64326431
}
64336432
removeLeadingNewlines(comments);
64346433
removeTrailingNewlines(comments);
6435-
result = createJSDocComment();
6434+
return createJSDocComment();
64366435
});
64376436

6438-
return result;
6439-
64406437
function removeLeadingNewlines(comments: string[]) {
64416438
while (comments.length && (comments[0] === "\n" || comments[0] === "\r")) {
64426439
comments.shift();

0 commit comments

Comments
 (0)