Skip to content

Commit 843e9df

Browse files
sandersnc0sta
authored andcommitted
Improve JSDocFunctionType readability (microsoft#56694)
1 parent f61229e commit 843e9df

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/compiler/parser.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3845,8 +3845,7 @@ namespace Parser {
38453845
function parseJSDocFunctionType(): JSDocFunctionType | TypeReferenceNode {
38463846
const pos = getNodePos();
38473847
const hasJSDoc = hasPrecedingJSDocComment();
3848-
if (lookAhead(nextTokenIsOpenParen)) {
3849-
nextToken();
3848+
if (tryParse(nextTokenIsOpenParen)) {
38503849
const parameters = parseParameters(SignatureFlags.Type | SignatureFlags.JSDoc);
38513850
const type = parseReturnType(SyntaxKind.ColonToken, /*isType*/ false);
38523851
return withJSDoc(finishNode(factory.createJSDocFunctionType(parameters, type), pos), hasJSDoc);

0 commit comments

Comments
 (0)