@@ -282,7 +282,7 @@ namespace ts {
282282
283283 function getSymbolLinks(symbol: Symbol): SymbolLinks {
284284 if (symbol.flags & SymbolFlags.Transient) return <TransientSymbol>symbol;
285- var id = getSymbolId(symbol);
285+ let id = getSymbolId(symbol);
286286 return symbolLinks[id] || (symbolLinks[id] = {});
287287 }
288288
@@ -630,7 +630,7 @@ namespace ts {
630630 }
631631
632632 function getTargetOfNamespaceImport(node: NamespaceImport): Symbol {
633- var moduleSpecifier = (<ImportDeclaration>node.parent.parent).moduleSpecifier;
633+ let moduleSpecifier = (<ImportDeclaration>node.parent.parent).moduleSpecifier;
634634 return resolveESModuleSymbol(resolveExternalModuleName(node, moduleSpecifier), moduleSpecifier);
635635 }
636636
@@ -685,7 +685,7 @@ namespace ts {
685685
686686 function getPropertyOfVariable(symbol: Symbol, name: string): Symbol {
687687 if (symbol.flags & SymbolFlags.Variable) {
688- var typeAnnotation = (<VariableDeclaration>symbol.valueDeclaration).type;
688+ let typeAnnotation = (<VariableDeclaration>symbol.valueDeclaration).type;
689689 if (typeAnnotation) {
690690 return resolveSymbol(getPropertyOfType(getTypeFromTypeNode(typeAnnotation), name));
691691 }
@@ -1305,7 +1305,7 @@ namespace ts {
13051305 // Mark the unexported alias as visible if its parent is visible
13061306 // because these kind of aliases can be used to name types in declaration file
13071307
1308- var anyImportSyntax = getAnyImportSyntax(declaration);
1308+ let anyImportSyntax = getAnyImportSyntax(declaration);
13091309 if (anyImportSyntax &&
13101310 !(anyImportSyntax.flags & NodeFlags.Export) && // import clause without export
13111311 isDeclarationVisible(<Declaration>anyImportSyntax.parent)) {
@@ -2086,14 +2086,14 @@ namespace ts {
20862086 }
20872087
20882088 function collectLinkedAliases(node: Identifier): Node[] {
2089- var exportSymbol: Symbol;
2089+ let exportSymbol: Symbol;
20902090 if (node.parent && node.parent.kind === SyntaxKind.ExportAssignment) {
20912091 exportSymbol = resolveName(node.parent, node.text, SymbolFlags.Value | SymbolFlags.Type | SymbolFlags.Namespace, Diagnostics.Cannot_find_name_0, node);
20922092 }
20932093 else if (node.parent.kind === SyntaxKind.ExportSpecifier) {
20942094 exportSymbol = getTargetOfExportSpecifier(<ExportSpecifier>node.parent);
20952095 }
2096- var result: Node[] = [];
2096+ let result: Node[] = [];
20972097 if (exportSymbol) {
20982098 buildVisibleNodeList(exportSymbol.declarations);
20992099 }
@@ -2102,16 +2102,16 @@ namespace ts {
21022102 function buildVisibleNodeList(declarations: Declaration[]) {
21032103 forEach(declarations, declaration => {
21042104 getNodeLinks(declaration).isVisible = true;
2105- var resultNode = getAnyImportSyntax(declaration) || declaration;
2105+ let resultNode = getAnyImportSyntax(declaration) || declaration;
21062106 if (!contains(result, resultNode)) {
21072107 result.push(resultNode);
21082108 }
21092109
21102110 if (isInternalModuleImportEqualsDeclaration(declaration)) {
21112111 // Add the referenced top container visible
2112- var internalModuleReference = <Identifier | QualifiedName>(<ImportEqualsDeclaration>declaration).moduleReference;
2113- var firstIdentifier = getFirstIdentifier(internalModuleReference);
2114- var importSymbol = resolveName(declaration, firstIdentifier.text, SymbolFlags.Value | SymbolFlags.Type | SymbolFlags.Namespace,
2112+ let internalModuleReference = <Identifier | QualifiedName>(<ImportEqualsDeclaration>declaration).moduleReference;
2113+ let firstIdentifier = getFirstIdentifier(internalModuleReference);
2114+ let importSymbol = resolveName(declaration, firstIdentifier.text, SymbolFlags.Value | SymbolFlags.Type | SymbolFlags.Namespace,
21152115 Diagnostics.Cannot_find_name_0, firstIdentifier);
21162116 buildVisibleNodeList(importSymbol.declarations);
21172117 }
@@ -2606,7 +2606,7 @@ namespace ts {
26062606
26072607 // The outer type parameters are those defined by enclosing generic classes, methods, or functions.
26082608 function getOuterTypeParametersOfClassOrInterface(symbol: Symbol): TypeParameter[] {
2609- var declaration = symbol.flags & SymbolFlags.Class ? symbol.valueDeclaration : getDeclarationOfKind(symbol, SyntaxKind.InterfaceDeclaration);
2609+ let declaration = symbol.flags & SymbolFlags.Class ? symbol.valueDeclaration : getDeclarationOfKind(symbol, SyntaxKind.InterfaceDeclaration);
26102610 return appendOuterTypeParameters(undefined, declaration);
26112611 }
26122612
@@ -9908,7 +9908,7 @@ namespace ts {
99089908 // we only need to perform these checks if we are emitting serialized type metadata for the target of a decorator.
99099909 switch (node.kind) {
99109910 case SyntaxKind.ClassDeclaration:
9911- var constructor = getFirstConstructorWithBody(<ClassDeclaration>node);
9911+ let constructor = getFirstConstructorWithBody(<ClassDeclaration>node);
99129912 if (constructor) {
99139913 checkParameterTypeAnnotationsAsExpressions(constructor);
99149914 }
@@ -10159,7 +10159,7 @@ namespace ts {
1015910159 return;
1016010160 }
1016110161
10162- var symbol = getSymbolOfNode(node);
10162+ let symbol = getSymbolOfNode(node);
1016310163 if (symbol.flags & SymbolFlags.FunctionScopedVariable) {
1016410164 let localDeclarationSymbol = resolveName(node, (<Identifier>node.name).text, SymbolFlags.Variable, /*nodeNotFoundErrorMessage*/ undefined, /*nameArg*/ undefined);
1016510165 if (localDeclarationSymbol &&
@@ -11404,7 +11404,7 @@ namespace ts {
1140411404 }
1140511405
1140611406 // expression part in ElementAccess\PropertyAccess should be either identifier or dottedName
11407- var current = expression;
11407+ let current = expression;
1140811408 while (current) {
1140911409 if (current.kind === SyntaxKind.Identifier) {
1141011410 break;
@@ -12614,7 +12614,7 @@ namespace ts {
1261412614 return false;
1261512615 }
1261612616
12617- var isValue = isAliasResolvedToValue(getSymbolOfNode(node));
12617+ let isValue = isAliasResolvedToValue(getSymbolOfNode(node));
1261812618 return isValue && node.moduleReference && !nodeIsMissing(node.moduleReference);
1261912619 }
1262012620
@@ -12698,7 +12698,7 @@ namespace ts {
1269812698 // here has no effect anyway as an identifier in a type name is not an expression.
1269912699 // var substitution = getExpressionNameSubstitution(<Identifier>node, getGeneratedNameForNode);
1270012700 // var text = substitution || (<Identifier>node).text;
12701- var text = (<Identifier>node).text;
12701+ let text = (<Identifier>node).text;
1270212702 if (fallbackPath) {
1270312703 fallbackPath.push(text);
1270412704 }
@@ -12707,8 +12707,8 @@ namespace ts {
1270712707 }
1270812708 }
1270912709 else {
12710- var left = serializeEntityName((<QualifiedName>node).left, fallbackPath);
12711- var right = serializeEntityName((<QualifiedName>node).right, fallbackPath);
12710+ let left = serializeEntityName((<QualifiedName>node).left, fallbackPath);
12711+ let right = serializeEntityName((<QualifiedName>node).right, fallbackPath);
1271212712 if (!fallbackPath) {
1271312713 return left + "." + right;
1271412714 }
@@ -12748,7 +12748,7 @@ namespace ts {
1274812748 return "Symbol";
1274912749 }
1275012750 else if (type === unknownType) {
12751- var fallbackPath: string[] = [];
12751+ let fallbackPath: string[] = [];
1275212752 serializeEntityName(node.typeName, fallbackPath);
1275312753 return fallbackPath;
1275412754 }
@@ -12843,22 +12843,22 @@ namespace ts {
1284312843 //
1284412844 // For the rules on serializing the type of each parameter declaration, see `serializeTypeOfDeclaration`.
1284512845 if (node) {
12846- var valueDeclaration: FunctionLikeDeclaration;
12846+ let valueDeclaration: FunctionLikeDeclaration;
1284712847 if (node.kind === SyntaxKind.ClassDeclaration) {
1284812848 valueDeclaration = getFirstConstructorWithBody(<ClassDeclaration>node);
1284912849 }
1285012850 else if (isFunctionLike(node) && nodeIsPresent((<FunctionLikeDeclaration>node).body)) {
1285112851 valueDeclaration = <FunctionLikeDeclaration>node;
1285212852 }
1285312853 if (valueDeclaration) {
12854- var result: (string | string[])[];
12855- var parameters = valueDeclaration.parameters;
12856- var parameterCount = parameters.length;
12854+ let result: (string | string[])[];
12855+ let parameters = valueDeclaration.parameters;
12856+ let parameterCount = parameters.length;
1285712857 if (parameterCount > 0) {
1285812858 result = new Array<string>(parameterCount);
12859- for (var i = 0; i < parameterCount; i++) {
12859+ for (let i = 0; i < parameterCount; i++) {
1286012860 if (parameters[i].dotDotDotToken) {
12861- var parameterType = parameters[i].type;
12861+ let parameterType = parameters[i].type;
1286212862 if (parameterType.kind === SyntaxKind.ArrayType) {
1286312863 parameterType = (<ArrayTypeNode>parameterType).elementType;
1286412864 }
@@ -12905,7 +12905,7 @@ namespace ts {
1290512905 }
1290612906
1290712907 function writeTypeOfExpression(expr: Expression, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter) {
12908- var type = getTypeOfExpression(expr);
12908+ let type = getTypeOfExpression(expr);
1290912909 getSymbolDisplayBuilder().buildTypeDisplay(type, writer, enclosingDeclaration, flags);
1291012910 }
1291112911
0 commit comments