@@ -5019,7 +5019,8 @@ namespace ts {
50195019 // If this is a JSDoc construct signature, then skip the first parameter in the
50205020 // parameter list. The first parameter represents the return type of the construct
50215021 // signature.
5022- for (let i = isJSConstructSignature ? 1 : 0, n = declaration.parameters.length; i < n; i++) {
5022+ const n = declaration.parameters.length;
5023+ for (let i = isJSConstructSignature ? 1 : 0; i < n; i++) {
50235024 const param = declaration.parameters[i];
50245025
50255026 let paramSymbol = param.symbol;
@@ -5118,7 +5119,8 @@ namespace ts {
51185119 function getSignaturesOfSymbol(symbol: Symbol): Signature[] {
51195120 if (!symbol) return emptyArray;
51205121 const result: Signature[] = [];
5121- for (let i = 0, len = symbol.declarations.length; i < len; i++) {
5122+ const len = symbol.declarations.length;
5123+ for (let i = 0; i < len; i++) {
51225124 const node = symbol.declarations[i];
51235125 switch (node.kind) {
51245126 case SyntaxKind.FunctionType:
@@ -5768,8 +5770,8 @@ namespace ts {
57685770 }
57695771
57705772 function isSubtypeOfAny(candidate: Type, types: Type[]): boolean {
5771- for (let i = 0, len = types.length; i < len; i++ ) {
5772- if (candidate !== types[i] && isTypeSubtypeOf(candidate, types[i] )) {
5773+ for (const type of types) {
5774+ if (candidate !== type && isTypeSubtypeOf(candidate, type )) {
57735775 return true;
57745776 }
57755777 }
@@ -7911,7 +7913,8 @@ namespace ts {
79117913 return Ternary.False;
79127914 }
79137915 let result = Ternary.True;
7914- for (let i = 0, len = sourceSignatures.length; i < len; i++) {
7916+ const len = sourceSignatures.length;
7917+ for (let i = 0; i < len; i++) {
79157918 const related = compareSignaturesIdentical(sourceSignatures[i], targetSignatures[i], /*partialMatch*/ false, /*ignoreThisTypes*/ false, /*ignoreReturnTypes*/ false, isRelatedTo);
79167919 if (!related) {
79177920 return Ternary.False;
@@ -18044,7 +18047,8 @@ namespace ts {
1804418047 /** Check each type parameter and check that type parameters have no duplicate type parameter declarations */
1804518048 function checkTypeParameters(typeParameterDeclarations: TypeParameterDeclaration[]) {
1804618049 if (typeParameterDeclarations) {
18047- for (let i = 0, n = typeParameterDeclarations.length; i < n; i++) {
18050+ const n = typeParameterDeclarations.length;
18051+ for (let i = 0; i < n; i++) {
1804818052 const node = typeParameterDeclarations[i];
1804918053 checkTypeParameter(node);
1805018054
@@ -18324,7 +18328,8 @@ namespace ts {
1832418328 // TypeScript 1.0 spec (April 2014):
1832518329 // When a generic interface has multiple declarations, all declarations must have identical type parameter
1832618330 // lists, i.e. identical type parameter names with identical constraints in identical order.
18327- for (let i = 0, len = list1.length; i < len; i++) {
18331+ const len = list1.length;
18332+ for (let i = 0; i < len; i++) {
1832818333 const tp1 = list1[i];
1832918334 const tp2 = list2[i];
1833018335 if (tp1.name.text !== tp2.name.text) {
@@ -20761,7 +20766,7 @@ namespace ts {
2076120766 case SyntaxKind.PublicKeyword:
2076220767 case SyntaxKind.ProtectedKeyword:
2076320768 case SyntaxKind.PrivateKeyword:
20764- let text = visibilityToString(modifierToFlag(modifier.kind));
20769+ const text = visibilityToString(modifierToFlag(modifier.kind));
2076520770
2076620771 if (modifier.kind === SyntaxKind.ProtectedKeyword) {
2076720772 lastProtected = modifier;
0 commit comments