@@ -184,7 +184,7 @@ namespace ts {
184
184
possibleImports = undefined ;
185
185
importDeclarationMap = createMap ( ) ;
186
186
necessaryTypeRefernces = undefined ;
187
- const refs = collectReferences ( currentSourceFile ) ;
187
+ const refs = collectReferences ( currentSourceFile , createMap ( ) ) ;
188
188
const references : FileReference [ ] = [ ] ;
189
189
const outputFilePath = getDirectoryPath ( normalizeSlashes ( getOutputPathsFor ( node , host , /*forceDtsPaths*/ true ) . declarationFilePath ) ) ;
190
190
const referenceVisitor = mapReferencesIntoArray ( references , outputFilePath ) ;
@@ -234,7 +234,7 @@ namespace ts {
234
234
}
235
235
}
236
236
237
- function collectReferences ( sourceFile : SourceFile , ret = createMap < SourceFile > ( ) ) {
237
+ function collectReferences ( sourceFile : SourceFile , ret : Map < SourceFile > ) {
238
238
if ( noResolve || isSourceFileJavaScript ( sourceFile ) ) return ret ;
239
239
forEach ( sourceFile . referencedFiles , f => {
240
240
const elem = tryResolveScriptReference ( host , sourceFile , f ) ;
@@ -497,7 +497,7 @@ namespace ts {
497
497
}
498
498
if ( decl . importClause . namedBindings . kind === SyntaxKind . NamespaceImport ) {
499
499
// Namespace import (optionally with visible default)
500
- const namedBindings = resolver . isDeclarationVisible ( decl . importClause . namedBindings as NamespaceImport ) ? decl . importClause . namedBindings : /*namedBindings*/ undefined ;
500
+ const namedBindings = resolver . isDeclarationVisible ( decl . importClause . namedBindings ) ? decl . importClause . namedBindings : /*namedBindings*/ undefined ;
501
501
return visibleDefaultBinding || namedBindings ? updateImportDeclaration ( decl , /*decorators*/ undefined , decl . modifiers , updateImportClause (
502
502
decl . importClause ,
503
503
visibleDefaultBinding ,
@@ -797,7 +797,7 @@ namespace ts {
797
797
798
798
switch ( input . kind ) {
799
799
case SyntaxKind . ExportDeclaration : {
800
- if ( ! resultHasExternalModuleIndicator && isSourceFile ( input . parent ) ) {
800
+ if ( isSourceFile ( input . parent ) ) {
801
801
resultHasExternalModuleIndicator = true ;
802
802
}
803
803
// Always visible if the parent node isn't dropped for being not visible
@@ -806,7 +806,7 @@ namespace ts {
806
806
}
807
807
case SyntaxKind . ExportAssignment : {
808
808
// Always visible if the parent node isn't dropped for being not visible
809
- if ( ! resultHasExternalModuleIndicator && isSourceFile ( input . parent ) ) {
809
+ if ( isSourceFile ( input . parent ) ) {
810
810
resultHasExternalModuleIndicator = true ;
811
811
}
812
812
if ( input . expression . kind === SyntaxKind . Identifier ) {
0 commit comments