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