@@ -845,7 +845,7 @@ namespace ts {
845845 return true;
846846 }
847847 const sourceFiles = host.getSourceFiles();
848- return indexOf(sourceFiles, declarationFile) <= indexOf(sourceFiles, useFile);
848+ return sourceFiles. indexOf(declarationFile) <= sourceFiles. indexOf(useFile);
849849 }
850850
851851 if (declaration.pos <= usage.pos) {
@@ -4336,7 +4336,7 @@ namespace ts {
43364336 }
43374337 else {
43384338 // 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);
43404340 type = isTupleLikeType(parentType)
43414341 ? getTypeOfPropertyOfType(parentType, propName as __String)
43424342 : elementType;
@@ -6758,15 +6758,15 @@ namespace ts {
67586758 if (node.initializer) {
67596759 const signatureDeclaration = <SignatureDeclaration>node.parent;
67606760 const signature = getSignatureFromDeclaration(signatureDeclaration);
6761- const parameterIndex = ts.indexOf( signatureDeclaration.parameters, node);
6761+ const parameterIndex = signatureDeclaration.parameters.indexOf( node);
67626762 Debug.assert(parameterIndex >= 0);
67636763 return parameterIndex >= signature.minArgumentCount;
67646764 }
67656765 const iife = getImmediatelyInvokedFunctionExpression(node.parent);
67666766 if (iife) {
67676767 return !node.type &&
67686768 !node.dotDotDotToken &&
6769- indexOf(( node.parent as SignatureDeclaration) .parameters, node) >= iife.arguments.length;
6769+ node.parent.parameters.indexOf( node) >= iife.arguments.length;
67706770 }
67716771
67726772 return false;
@@ -8707,7 +8707,7 @@ namespace ts {
87078707 * This is used during inference when instantiating type parameter defaults.
87088708 */
87098709 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;
87118711 }
87128712
87138713 function isInferenceContext(mapper: TypeMapper): mapper is InferenceContext {
@@ -10550,7 +10550,7 @@ namespace ts {
1055010550 let result = "" + type.target.id;
1055110551 for (const t of type.typeArguments) {
1055210552 if (isUnconstrainedTypeParameter(t)) {
10553- let index = indexOf(typeParameters, t);
10553+ let index = typeParameters. indexOf(t);
1055410554 if (index < 0) {
1055510555 index = typeParameters.length;
1055610556 typeParameters.push(t);
@@ -12120,7 +12120,7 @@ namespace ts {
1212012120 }
1212112121
1212212122 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));
1212412124 }
1212512125
1212612126 function getAssignedTypeOfSpreadExpression(node: SpreadElement): Type {
@@ -12164,7 +12164,7 @@ namespace ts {
1216412164 const type = pattern.kind === SyntaxKind.ObjectBindingPattern ?
1216512165 getTypeOfDestructuredProperty(parentType, node.propertyName || <Identifier>node.name) :
1216612166 !node.dotDotDotToken ?
12167- getTypeOfDestructuredArrayElement(parentType, indexOf( pattern.elements, node)) :
12167+ getTypeOfDestructuredArrayElement(parentType, pattern.elements.indexOf( node)) :
1216812168 getTypeOfDestructuredSpreadExpression(parentType);
1216912169 return getTypeWithDefault(type, node.initializer);
1217012170 }
@@ -13918,7 +13918,7 @@ namespace ts {
1391813918 if (isContextSensitiveFunctionOrObjectLiteralMethod(func)) {
1391913919 const iife = getImmediatelyInvokedFunctionExpression(func);
1392013920 if (iife && iife.arguments) {
13921- const indexOfParameter = indexOf( func.parameters, parameter);
13921+ const indexOfParameter = func.parameters.indexOf( parameter);
1392213922 if (parameter.dotDotDotToken) {
1392313923 const restTypes: Type[] = [];
1392413924 for (let i = indexOfParameter; i < iife.arguments.length; i++) {
@@ -13939,7 +13939,7 @@ namespace ts {
1393913939 if (contextualSignature) {
1394013940 const funcHasRestParameters = hasRestParameter(func);
1394113941 const len = func.parameters.length - (funcHasRestParameters ? 1 : 0);
13942- let indexOfParameter = indexOf( func.parameters, parameter);
13942+ let indexOfParameter = func.parameters.indexOf( parameter);
1394313943 if (getThisParameter(func) !== undefined && !contextualSignature.thisParameter) {
1394413944 Debug.assert(indexOfParameter !== 0); // Otherwise we should not have called `getContextuallyTypedParameterType`.
1394513945 indexOfParameter -= 1;
@@ -14070,7 +14070,7 @@ namespace ts {
1407014070 // In a typed function call, an argument or substitution expression is contextually typed by the type of the corresponding parameter.
1407114071 function getContextualTypeForArgument(callTarget: CallLikeExpression, arg: Expression): Type {
1407214072 const args = getEffectiveCallArguments(callTarget);
14073- const argIndex = indexOf(args, arg);
14073+ const argIndex = args. indexOf(arg);
1407414074 if (argIndex >= 0) {
1407514075 // If we're already in the process of resolving the given signature, don't resolve again as
1407614076 // that could cause infinite recursion. Instead, return anySignature.
@@ -17236,7 +17236,7 @@ namespace ts {
1723617236 }
1723717237 excludeCount--;
1723817238 if (excludeCount > 0) {
17239- excludeArgument[indexOf(excludeArgument, /*value*/ true)] = false;
17239+ excludeArgument[excludeArgument. indexOf(/*value*/ true)] = false;
1724017240 }
1724117241 else {
1724217242 excludeArgument = undefined;
@@ -19497,7 +19497,7 @@ namespace ts {
1949719497 error(node, Diagnostics.A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature);
1949819498 }
1949919499 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) {
1950119501 error(node, Diagnostics.A_0_parameter_must_be_the_first_parameter, node.name.escapedText as string);
1950219502 }
1950319503 if (func.kind === SyntaxKind.Constructor || func.kind === SyntaxKind.ConstructSignature || func.kind === SyntaxKind.ConstructorType) {
@@ -20604,7 +20604,7 @@ namespace ts {
2060420604
2060520605 const promisedType = getPromisedTypeOfPromise(type);
2060620606 if (promisedType) {
20607- if (type.id === promisedType.id || indexOf(awaitedTypeStack, promisedType.id) >= 0) {
20607+ if (type.id === promisedType.id || awaitedTypeStack. indexOf(promisedType.id) >= 0) {
2060820608 // Verify that we don't have a bad actor in the form of a promise whose
2060920609 // promised type is the same as the promise type, or a mutually recursive
2061020610 // promise. If so, we return undefined as we cannot guess the shape. If this
@@ -24651,7 +24651,7 @@ namespace ts {
2465124651 const typeOfArrayLiteral = getTypeOfArrayLiteralOrObjectLiteralDestructuringAssignment(<Expression>expr.parent);
2465224652 const elementType = checkIteratedTypeOrElementType(typeOfArrayLiteral || unknownType, expr.parent, /*allowStringInput*/ false, /*allowAsyncIterables*/ false) || unknownType;
2465324653 return checkArrayLiteralDestructuringElementAssignment(<ArrayLiteralExpression>expr.parent, typeOfArrayLiteral,
24654- indexOf(( <ArrayLiteralExpression>expr.parent).elements, expr), elementType || unknownType);
24654+ ( <ArrayLiteralExpression>expr.parent).elements.indexOf( expr), elementType || unknownType);
2465524655 }
2465624656
2465724657 // Gets the property symbol corresponding to the property in destructuring assignment
0 commit comments