@@ -546,7 +546,7 @@ namespace ts {
546
546
let resolveModuleNamesWorker : ( moduleNames : string [ ] , containingFile : string , reusedNames ?: string [ ] ) => ResolvedModuleFull [ ] ;
547
547
const hasInvalidatedResolution = host . hasInvalidatedResolution || returnFalse ;
548
548
if ( host . resolveModuleNames ) {
549
- resolveModuleNamesWorker = ( moduleNames , containingFile , reusedNames ) => host . resolveModuleNames ( checkAllDefined ( moduleNames ) , containingFile , reusedNames ) . map ( resolved => {
549
+ resolveModuleNamesWorker = ( moduleNames , containingFile , reusedNames ) => host . resolveModuleNames ( Debug . assertEachDefined ( moduleNames ) , containingFile , reusedNames ) . map ( resolved => {
550
550
// An older host may have omitted extension, in which case we should infer it from the file extension of resolvedFileName.
551
551
if ( ! resolved || ( resolved as ResolvedModuleFull ) . extension !== undefined ) {
552
552
return resolved as ResolvedModuleFull ;
@@ -559,16 +559,16 @@ namespace ts {
559
559
else {
560
560
moduleResolutionCache = createModuleResolutionCache ( currentDirectory , x => host . getCanonicalFileName ( x ) ) ;
561
561
const loader = ( moduleName : string , containingFile : string ) => resolveModuleName ( moduleName , containingFile , options , host , moduleResolutionCache ) . resolvedModule ;
562
- resolveModuleNamesWorker = ( moduleNames , containingFile ) => loadWithLocalCache ( checkAllDefined ( moduleNames ) , containingFile , loader ) ;
562
+ resolveModuleNamesWorker = ( moduleNames , containingFile ) => loadWithLocalCache ( Debug . assertEachDefined ( moduleNames ) , containingFile , loader ) ;
563
563
}
564
564
565
565
let resolveTypeReferenceDirectiveNamesWorker : ( typeDirectiveNames : string [ ] , containingFile : string ) => ResolvedTypeReferenceDirective [ ] ;
566
566
if ( host . resolveTypeReferenceDirectives ) {
567
- resolveTypeReferenceDirectiveNamesWorker = ( typeDirectiveNames , containingFile ) => host . resolveTypeReferenceDirectives ( checkAllDefined ( typeDirectiveNames ) , containingFile ) ;
567
+ resolveTypeReferenceDirectiveNamesWorker = ( typeDirectiveNames , containingFile ) => host . resolveTypeReferenceDirectives ( Debug . assertEachDefined ( typeDirectiveNames ) , containingFile ) ;
568
568
}
569
569
else {
570
570
const loader = ( typesRef : string , containingFile : string ) => resolveTypeReferenceDirective ( typesRef , containingFile , options , host ) . resolvedTypeReferenceDirective ;
571
- resolveTypeReferenceDirectiveNamesWorker = ( typeReferenceDirectiveNames , containingFile ) => loadWithLocalCache ( checkAllDefined ( typeReferenceDirectiveNames ) , containingFile , loader ) ;
571
+ resolveTypeReferenceDirectiveNamesWorker = ( typeReferenceDirectiveNames , containingFile ) => loadWithLocalCache ( Debug . assertEachDefined ( typeReferenceDirectiveNames ) , containingFile , loader ) ;
572
572
}
573
573
574
574
// Map from a stringified PackageId to the source file with that id.
@@ -2428,11 +2428,6 @@ namespace ts {
2428
2428
}
2429
2429
}
2430
2430
2431
- function checkAllDefined ( names : string [ ] ) : string [ ] {
2432
- Debug . assert ( names . every ( name => name !== undefined ) , "A name is undefined." , ( ) => JSON . stringify ( names ) ) ;
2433
- return names ;
2434
- }
2435
-
2436
2431
function getModuleNames ( { imports, moduleAugmentations } : SourceFile ) : string [ ] {
2437
2432
const res = imports . map ( i => i . text ) ;
2438
2433
for ( const aug of moduleAugmentations ) {
0 commit comments