@@ -37,7 +37,7 @@ namespace ts {
37
37
let contextObjectForFile : Identifier ;
38
38
let exportedLocalNames : Identifier [ ] ;
39
39
let exportedFunctionDeclarations : ExpressionStatement [ ] ;
40
- let noSubstitution : Map < boolean > = { } ;
40
+ const noSubstitution : Map < boolean > = { } ;
41
41
42
42
return transformSourceFile ;
43
43
@@ -992,7 +992,7 @@ namespace ts {
992
992
993
993
function hasExportedReferenceInArrayDestructuringElement ( node : Expression ) : boolean {
994
994
if ( isSpreadElementExpression ( node ) ) {
995
- let expression = node . expression ;
995
+ const expression = node . expression ;
996
996
return isIdentifier ( expression ) && isExportedBinding ( expression ) ;
997
997
}
998
998
else {
@@ -1002,7 +1002,7 @@ namespace ts {
1002
1002
1003
1003
function hasExportedReferenceInDestructuringElement ( node : Expression ) : boolean {
1004
1004
if ( isBinaryExpression ( node ) ) {
1005
- let left = node . left ;
1005
+ const left = node . left ;
1006
1006
return node . operatorToken . kind === SyntaxKind . EqualsToken
10000
span>
1007
1007
&& isDestructuringPattern ( left )
1008
1008
&& hasExportedReferenceInDestructuringPattern ( left ) ;
@@ -1011,7 +1011,7 @@ namespace ts {
1011
1011
return isExportedBinding ( node ) ;
1012
1012
}
1013
1013
else if ( isSpreadElementExpression ( node ) ) {
1014
- let expression = node . expression ;
1014
+ const expression = node . expression ;
1015
1015
return isIdentifier ( expression ) && isExportedBinding ( expression ) ;
1016
1016
}
1017
1017
else if ( isDestructuringPattern ( node ) ) {
@@ -1052,7 +1052,7 @@ namespace ts {
1052
1052
}
1053
1053
1054
1054
function getExternalModuleNameLiteral ( importNode : ImportDeclaration | ExportDeclaration | ImportEqualsDeclaration ) {
1055
- let moduleName = getExternalModuleName ( importNode ) ;
1055
+ const moduleName = getExternalModuleName ( importNode ) ;
1056
1056
if ( moduleName . kind === SyntaxKind . StringLiteral ) {
1057
1057
return tryRenameExternalModule ( < StringLiteral > moduleName )
1058
1058
|| getSynthesizedNode ( < StringLiteral > moduleName ) ;
@@ -1074,12 +1074,12 @@ namespace ts {
1074
1074
}
1075
1075
1076
1076
function getLocalNameTextForExternalImport ( node : ImportDeclaration | ExportDeclaration | ImportEqualsDeclaration ) : string {
1077
- let name = getLocalNameForExternalImport ( node ) ;
1077
+ const name = getLocalNameForExternalImport ( node ) ;
1078
1078
return name ? name . text : undefined ;
1079
1079
}
1080
1080
1081
1081
function getLocalNameForExternalImport ( node : ImportDeclaration | ExportDeclaration | ImportEqualsDeclaration ) : Identifier {
1082
- let namespaceDeclaration = getNamespaceDeclarationNode ( node ) ;
1082
+ const namespaceDeclaration = getNamespaceDeclarationNode ( node ) ;
1083
1083
if ( namespaceDeclaration && ! isDefaultImport ( node ) ) {
1084
1084
return createIdentifier ( getSourceTextOfNodeFromSourceFile ( currentSourceFile , namespaceDeclaration . name ) ) ;
1085
1085
}
@@ -1182,8 +1182,8 @@ namespace ts {
1182
1182
* @param node The declaration to export.
1183
1183
*/
1184
1184
function createDeclarationExport ( node : DeclarationStatement ) {
1185
- let declarationName = getDeclarationName ( node ) ;
1186
- let exportName = node . flags & NodeFlags . Default ? createLiteral ( "default" ) : declarationName ;
1185
+ const declarationName = getDeclarationName ( node ) ;
1186
+ const exportName = node . flags & NodeFlags . Default ? createLiteral ( "default" ) : declarationName ;
1187
1187
return createExportStatement ( exportName , declarationName ) ;
1188
1188
}
1189
1189
@@ -1209,15 +1209,15 @@ namespace ts {
1209
1209
}
1210
1210
1211
1211
function collectDependencyGroups ( externalImports : ( ImportDeclaration | ImportEqualsDeclaration | ExportDeclaration ) [ ] ) {
1212
- let groupIndices : Map < number > = { } ;
1213
- let dependencyGroups : DependencyGroup [ ] = [ ] ;
1214
- for ( let i = 0 ; i < externalImports . length ; ++ i ) {
1215
- let externalImport = externalImports [ i ] ;
1216
- let externalModuleName = getExternalModuleNameLiteral ( externalImport ) ;
1217
- let text = externalModuleName . text ;
1212
+ const groupIndices : Map < number > = { } ;
1213
+ const dependencyGroups : DependencyGroup [ ] = [ ] ;
1214
+ for ( let i = 0 ; i < externalImports . length ; i ++ ) {
1215
+ const externalImport = externalImports [ i ] ;
1216
+ const externalModuleName = getExternalModuleNameLiteral ( externalImport ) ;
1217
+ const text = externalModuleName . text ;
1218
1218
if ( hasProperty ( groupIndices , text ) ) {
1219
1219
// deduplicate/group entries in dependency list by the dependency name
1220
- let groupIndex = groupIndices [ text ] ;
1220
+ const groupIndex = groupIndices [ text ] ;
1221
1221
dependencyGroups [ groupIndex ] . externalImports . push ( externalImport ) ;
1222
1222
continue ;
1223
1223
}
@@ -1245,14 +1245,6 @@ namespace ts {
1245
1245
exportedLocalNames . push ( name ) ;
1246
1246
}
1247
1247
1248
- function hoistExportedVariableDeclaration ( name : Identifier ) {
1249
-
1250
- }
1251
-
1252
- function hoistExportedFunctionDeclaration ( node : FunctionDeclaration ) {
1253
-
1254
- }
1255
-
1256
1248
function recordExportedFunctionDeclaration ( node : FunctionDeclaration ) {
1257
1249
if ( ! exportedFunctionDeclarations ) {
1258
1250
exportedFunctionDeclarations = [ ] ;
@@ -1262,7 +1254,7 @@ namespace ts {
1262
1254
}
1263
1255
1264
1256
function hoistBindingElement ( node : VariableDeclaration | BindingElement , isExported : boolean ) {
1265
- let name = node . name ;
1257
+ const name = node . name ;
1266
1258
if ( isIdentifier ( name ) ) {
1267
1259
hoistVariableDeclaration ( getSynthesizedNode ( name ) ) ;
1268
1260
if ( isExported ) {
0 commit comments