@@ -845,7 +845,7 @@ namespace ts {
845
845
return true;
846
846
}
847
847
const sourceFiles = host.getSourceFiles();
848
- return indexOf(sourceFiles, declarationFile) <= indexOf(sourceFiles, useFile);
848
+ return sourceFiles. indexOf(declarationFile) <= sourceFiles. indexOf(useFile);
849
849
}
850
850
851
851
if (declaration.pos <= usage.pos) {
@@ -4336,7 +4336,7 @@ namespace ts {
4336
4336
}
4337
4337
else {
4338
4338
// Use specific property type when parent is a tuple or numeric index type when parent is an array
4339
- const propName = "" + indexOf( pattern.elements, declaration);
4339
+ const propName = "" + pattern.elements.indexOf( declaration);
4340
4340
type = isTupleLikeType(parentType)
4341
4341
? getTypeOfPropertyOfType(parentType, propName as __String)
4342
4342
: elementType;
@@ -6758,15 +6758,15 @@ namespace ts {
6758
6758
if (node.initializer) {
6759
6759
const signatureDeclaration = <SignatureDeclaration>node.parent;
6760
6760
const signature = getSignatureFromDeclaration(signatureDeclaration);
6761
- const parameterIndex = ts.indexOf( signatureDeclaration.parameters, node);
6761
+ const parameterIndex = signatureDeclaration.parameters.indexOf( node);
6762
6762
Debug.assert(parameterIndex >= 0);
6763
6763
return parameterIndex >= signature.minArgumentCount;
6764
6764
}
6765
6765
const iife = getImmediatelyInvokedFunctionExpression(node.parent);
6766
6766
if (iife) {
6767
6767
return !node.type &&
6768
6768
!node.dotDotDotToken &&
6769
- indexOf(( node.parent as SignatureDeclaration) .parameters, node) >= iife.arguments.length;
6769
+ node.parent.parameters.indexOf( node) >= iife.arguments.length;
6770
6770
}
6771
6771
6772
6772
return false;
@@ -8707,7 +8707,7 @@ namespace ts {
8707
8707
* This is used during inference when instantiating type parameter defaults.
8708
8708
*/
8709
8709
function createBackreferenceMapper(typeParameters: TypeParameter[], index: number): TypeMapper {
8710
- return t => indexOf(typeParameters, t) >= index ? emptyObjectType : t;
8710
+ return t => typeParameters. indexOf(t) >= index ? emptyObjectType : t;
8711
8711
}
8712
8712
8713
8713
function isInferenceContext(mapper: TypeMapper): mapper is InferenceContext {
@@ -10550,7 +10550,7 @@ namespace ts {
10550
10550
let result = "" + type.target.id;
10551
10551
for (const t of type.typeArguments) {
10552
10552
if (isUnconstrainedTypeParameter(t)) {
10553
- let index = indexOf(typeParameters, t);
10553
+ let index = typeParameters. indexOf(t);
10554
10554
if (index < 0) {
10555
10555
index = typeParameters.length;
10556
10556
typeParameters.push(t);
@@ -12120,7 +12120,7 @@ namespace ts {
12120
12120
}
12121
12121
12122
12122
function getAssignedTypeOfArrayLiteralElement(node: ArrayLiteralExpression, element: Expression): Type {
12123
- return getTypeOfDestructuredArrayElement(getAssignedType(node), indexOf( node.elements, element));
12123
+ return getTypeOfDestructuredArrayElement(getAssignedType(node), node.elements.indexOf( element));
12124
12124
}
12125
12125
12126
12126
function getAssignedTypeOfSpreadExpression(node: SpreadElement): Type {
@@ -12164,7 +12164,7 @@ namespace ts {
12164
12164
const type = pattern.kind === SyntaxKind.ObjectBindingPattern ?
12165
12165
getTypeOfDestructuredProperty(parentType, node.propertyName || <Identifier>node.name) :
12166
12166
!node.dotDotDotToken ?
12167
- getTypeOfDestructuredArrayElement(parentType, indexOf( pattern.elements, node)) :
12167
+ getTypeOfDestructuredArrayElement(parentType, pattern.elements.indexOf( node)) :
12168
12168
getTypeOfDestructuredSpreadExpression(parentType);
12169
12169
return getTypeWithDefault(type, node.initializer);
12170
12170
}
@@ -13918,7 +13918,7 @@ namespace ts {
13918
13918
if (isContextSensitiveFunctionOrObjectLiteralMethod(func)) {
13919
13919
const iife = getImmediatelyInvokedFunctionExpression(func);
13920
13920
if (iife && iife.arguments) {
13921
- const indexOfParameter = indexOf( func.parameters, parameter);
13921
+ const indexOfParameter = func.parameters.indexOf( parameter);
13922
13922
if (parameter.dotDotDotToken) {
13923
13923
const restTypes: Type[] = [];
13924
13924
for (let i = indexOfParameter; i < iife.arguments.length; i++) {
@@ -13939,7 +13939,7 @@ namespace ts {
13939
13939
if (contextualSignature) {
13940
13940
const funcHasRestParameters = hasRestParameter(func);
13941
13941
const len = func.parameters.length - (funcHasRestParameters ? 1 : 0);
13942
- let indexOfParameter = indexOf( func.parameters, parameter);
13942
+ let indexOfParameter = func.parameters.indexOf( parameter);
13943
13943
if (getThisParameter(func) !== undefined && !contextualSignature.thisParameter) {
13944
13944
Debug.assert(indexOfParameter !== 0); // Otherwise we should not have called `getContextuallyTypedParameterType`.
13945
13945
indexOfParameter -= 1;
@@ -14070,7 +14070,7 @@ namespace ts {
14070
14070
// In a typed function call, an argument or substitution expression is contextually typed by the type of the corresponding parameter.
14071
14071
function getContextualTypeForArgument(callTarget: CallLikeExpression, arg: Expression): Type {
14072
14072
const args = getEffectiveCallArguments(callTarget);
14073
- const argIndex = indexOf(args, arg);
14073
+ const argIndex = args. indexOf(arg);
14074
14074
if (argIndex >= 0) {
14075
14075
// If we're already in the process of resolving the given signature, don't resolve again as
14076
14076
// that could cause infinite recursion. Instead, return anySignature.
@@ -17236,7 +17236,7 @@ namespace ts {
17236
17236
}
17237
17237
excludeCount--;
17238
17238
if (excludeCount > 0) {
17239
- excludeArgument[indexOf(excludeArgument, /*value*/ true)] = false;
17239
+ excludeArgument[excludeArgument. indexOf(/*value*/ true)] = false;
17240
17240
}
17241
17241
else {
17242
17242
excludeArgument = undefined;
@@ -19497,7 +19497,7 @@ namespace ts {
19497
19497
error(node, Diagnostics.A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature);
19498
19498
}
19499
19499
if (node.name && isIdentifier(node.name) && (node.name.escapedText === "this" || node.name.escapedText === "new")) {
19500
- if (indexOf( func.parameters, node) !== 0) {
19500
+ if (func.parameters.indexOf( node) !== 0) {
19501
19501
error(node, Diagnostics.A_0_parameter_must_be_the_first_parameter, node.name.escapedText as string);
19502
19502
}
19503
19503
if (func.kind === SyntaxKind.Constructor || func.kind === SyntaxKind.ConstructSignature || func.kind === SyntaxKind.ConstructorType) {
@@ -20604,7 +20604,7 @@ namespace ts {
20604
20604
20605
20605
const promisedType = getPromisedTypeOfPromise(type);
20606
20606
if (promisedType) {
20607
- if (type.id === promisedType.id || indexOf(awaitedTypeStack, promisedType.id) >= 0) {
20607
+ if (type.id === promisedType.id || awaitedTypeStack. indexOf(promisedType.id) >= 0) {
20608
20608
// Verify that we don't have a bad actor in the form of a promise whose
20609
20609
// promised type is the same as the promise type, or a mutually recursive
20610
20610
// promise. If so, we return undefined as we cannot guess the shape. If this
@@ -24651,7 +24651,7 @@ namespace ts {
24651
24651
const typeOfArrayLiteral = getTypeOfArrayLiteralOrObjectLiteralDestructuringAssignment(<Expression>expr.parent);
24652
24652
const elementType = checkIteratedTypeOrElementType(typeOfArrayLiteral || unknownType, expr.parent, /*allowStringInput*/ false, /*allowAsyncIterables*/ false) || unknownType;
24653
24653
return checkArrayLiteralDestructuringElementAssignment(<ArrayLiteralExpression>expr.parent, typeOfArrayLiteral,
24654
- indexOf(( <ArrayLiteralExpression>expr.parent).elements, expr), elementType || unknownType);
24654
+ ( <ArrayLiteralExpression>expr.parent).elements.indexOf( expr), elementType || unknownType);
24655
24655
}
24656
24656
24657
24657
// Gets the property symbol corresponding to the property in destructuring assignment
0 commit comments