@@ -184,7 +184,7 @@ namespace ts {
184184 possibleImports = undefined ;
185185 importDeclarationMap = createMap ( ) ;
186186 necessaryTypeRefernces = undefined ;
187- const refs = collectReferences ( currentSourceFile ) ;
187+ const refs = collectReferences ( currentSourceFile , createMap ( ) ) ;
188188 const references : FileReference [ ] = [ ] ;
189189 const outputFilePath = getDirectoryPath ( normalizeSlashes ( getOutputPathsFor ( node , host , /*forceDtsPaths*/ true ) . declarationFilePath ) ) ;
190190 const referenceVisitor = mapReferencesIntoArray ( references , outputFilePath ) ;
@@ -234,7 +234,7 @@ namespace ts {
234234 }
235235 }
236236
237- function collectReferences ( sourceFile : SourceFile , ret = createMap < SourceFile > ( ) ) {
237+ function collectReferences ( sourceFile : SourceFile , ret : Map < SourceFile > ) {
238238 if ( noResolve || isSourceFileJavaScript ( sourceFile ) ) return ret ;
239239 forEach ( sourceFile . referencedFiles , f => {
240240 const elem = tryResolveScriptReference ( host , sourceFile , f ) ;
@@ -497,7 +497,7 @@ namespace ts {
497497 }
498498 if ( decl . importClause . namedBindings . kind === SyntaxKind . NamespaceImport ) {
499499 // 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 ;
501501 return visibleDefaultBinding || namedBindings ? updateImportDeclaration ( decl , /*decorators*/ undefined , decl . modifiers , updateImportClause (
502502 decl . importClause ,
503503 visibleDefaultBinding ,
@@ -797,7 +797,7 @@ namespace ts {
797797
798798 switch ( input . kind ) {
799799 case SyntaxKind . ExportDeclaration : {
800- if ( ! resultHasExternalModuleIndicator && isSourceFile ( input . parent ) ) {
800+ if ( isSourceFile ( input . parent ) ) {
801801 resultHasExternalModuleIndicator = true ;
802802 }
803803 // Always visible if the parent node isn't dropped for being not visible
@@ -806,7 +806,7 @@ namespace ts {
806806 }
807807 case SyntaxKind . ExportAssignment : {
808808 // Always visible if the parent node isn't dropped for being not visible
809- if ( ! resultHasExternalModuleIndicator && isSourceFile ( input . parent ) ) {
809+ if ( isSourceFile ( input . parent ) ) {
810810 resultHasExternalModuleIndicator = true ;
811811 }
812812 if ( input . expression . kind === SyntaxKind . Identifier ) {
0 commit comments