Rename isStartOfType parameter used by isStartOfParameter
This commit is contained in:
parent
a5c2eac2ee
commit
90d9f3d4ba
|
@ -2238,7 +2238,7 @@ namespace ts {
|
|||
isIdentifierOrPattern() ||
|
||||
isModifierKind(token()) ||
|
||||
token() === SyntaxKind.AtToken ||
|
||||
isStartOfType(/*disableLookahead*/ true);
|
||||
isStartOfType(/*inStartOfParameter*/ true);
|
||||
}
|
||||
|
||||
function parseParameter(): ParameterDeclaration {
|
||||
|
@ -2699,7 +2699,7 @@ namespace ts {
|
|||
}
|
||||
}
|
||||
|
||||
function isStartOfType(disableLookahead?: boolean): boolean {
|
||||
function isStartOfType(inStartOfParameter?: boolean): boolean {
|
||||
switch (token()) {
|
||||
case SyntaxKind.AnyKeyword:
|
||||
case SyntaxKind.StringKeyword:
|
||||
|
@ -2729,11 +2729,11 @@ namespace ts {
|
|||
case SyntaxKind.DotDotDotToken:
|
||||
return true;
|
||||
case SyntaxKind.MinusToken:
|
||||
return !disableLookahead && lookAhead(nextTokenIsNumericLiteral);
|
||||
return !inStartOfParameter && lookAhead(nextTokenIsNumericLiteral);
|
||||
case SyntaxKind.OpenParenToken:
|
||||
// Only consider '(' the start of a type if followed by ')', '...', an identifier, a modifier,
|
||||
// or something that starts a type. We don't want to consider things like '(1)' a type.
|
||||
return !disableLookahead && lookAhead(isStartOfParenthesizedOrFunctionType);
|
||||
return !inStartOfParameter && lookAhead(isStartOfParenthesizedOrFunctionType);
|
||||
default:
|
||||
return isIdentifier();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue