mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-10 15:25:54 -06:00
Fix for loop which retains jsdoc behaviors
This commit is contained in:
parent
7cb8ce4346
commit
e7bf44e820
@ -1881,6 +1881,11 @@ namespace ts {
|
||||
if (considerSemicolonAsDelimiter && token() === SyntaxKind.SemicolonToken && !scanner.hasPrecedingLineBreak()) {
|
||||
nextToken();
|
||||
}
|
||||
else if (isJSDocParameterStart() && parsingContext & (1 << ParsingContext.Parameters)) {
|
||||
// If the token was a jsdoc parameter start and we're parsing parameter lists,
|
||||
// we need to consume the (mostly erroneous) parameter token
|
||||
nextToken();
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -2202,7 +2207,11 @@ namespace ts {
|
||||
return token() === SyntaxKind.DotDotDotToken ||
|
||||
isIdentifierOrPattern() ||
|
||||
isModifierKind(token()) ||
|
||||
token() === SyntaxKind.AtToken || token() === SyntaxKind.ThisKeyword || token() === SyntaxKind.NewKeyword ||
|
||||
token() === SyntaxKind.AtToken || token() === SyntaxKind.ThisKeyword || isJSDocParameterStart();
|
||||
}
|
||||
|
||||
function isJSDocParameterStart(): boolean {
|
||||
return token() === SyntaxKind.NewKeyword ||
|
||||
token() === SyntaxKind.StringLiteral || token() === SyntaxKind.NumericLiteral;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user