@@ -479,7 +479,7 @@ namespace ts {
479
479
// Maps from a SourceFile's `.path` to the name of the package it was imported with.
480
480
let sourceFileToPackageName = createMap < string > ( ) ;
481
481
// See `sourceFileIsRedirectedTo`.
482
- let isSourceFileTargetOfRedirect = createMap < true > ( ) ;
482
+ let redirectTargetsSet = createMap < true > ( ) ;
483
483
484
484
const filesByName = createMap < SourceFile | undefined > ( ) ;
485
485
// stores 'filename -> file association' ignoring case
@@ -558,7 +558,7 @@ namespace ts {
558
558
dropDiagnosticsProducingTypeChecker,
559
559
getSourceFileFromReference,
560
560
sourceFileToPackageName,
561
- isSourceFileTargetOfRedirect ,
561
+ redirectTargetsSet ,
562
562
} ;
563
563
564
564
verifyCompilerOptions ( ) ;
@@ -797,12 +797,12 @@ namespace ts {
797
797
if ( oldSourceFile . redirect ) {
798
798
// We got `newSourceFile` by path, so it is actually for the underlying file.
799
799
// This lets us know if the underlying file has changed. If it has we should break the redirect.
800
- if ( newSourceFile !== oldSourceFile . redirect . underlying ) {
800
+ if ( newSourceFile !== oldSourceFile . redirect . unredirected ) {
801
801
// Underlying file has changed. Might not redirect anymore. Must rebuild program.
802
802
return oldProgram . structureIsReused = StructureIsReused . Not ;
803
803
}
804
804
}
805
- else if ( oldProgram . isSourceFileTargetOfRedirect . has ( oldSourceFile . path ) ) {
805
+ else if ( oldProgram . redirectTargetsSet . has ( oldSourceFile . path ) ) {
806
806
// This is similar to the above case. If a redirected-to source file changes, the redirect may be broken.
807
807
if ( newSourceFile !== oldSourceFile ) {
808
808
return oldProgram . structureIsReused = StructureIsReused . Not ;
@@ -941,7 +941,7 @@ namespace ts {
941
941
resolvedTypeReferenceDirectives = oldProgram . getResolvedTypeReferenceDirectives ( ) ;
942
942
943
943
sourceFileToPackageName = oldProgram . sourceFileToPackageName ;
944
- isSourceFileTargetOfRedirect = oldProgram . isSourceFileTargetOfRedirect ;
944
+ redirectTargetsSet = oldProgram . redirectTargetsSet ;
945
945
946
946
return oldProgram . structureIsReused = StructureIsReused . Completely ;
947
947
}
@@ -1597,19 +1597,19 @@ namespace ts {
1597
1597
}
1598
1598
}
1599
1599
1600
- function createRedirectSourceFile ( redirectTo : SourceFile , underlying : SourceFile , fileName : string , path : Path ) : SourceFile {
1601
- const redirect : SourceFile = Object . create ( redirectTo ) ;
1600
+ function createRedirectSourceFile ( redirectTarget : SourceFile , unredirected : SourceFile , fileName : string , path : Path ) : SourceFile {
1601
+ const redirect : SourceFile = Object . create ( redirectTarget ) ;
1602
1602
redirect . fileName = fileName ;
1603
1603
redirect . path = path ;
1604
- redirect . redirect = { redirectTo , underlying } ;
1604
+ redirect . redirect = { redirectTarget , unredirected } ;
1605
1605
Object . defineProperties ( redirect , {
1606
1606
id : {
1607
- get ( this : SourceFile ) { return this . redirect . redirectTo . id ; } ,
1608
- set ( this : SourceFile , value : SourceFile [ "id" ] ) { this . redirect . redirectTo . id = value ; } ,
1607
+ get ( this : SourceFile ) { return this . redirect . redirectTarget . id ; } ,
1608
+ set ( this : SourceFile , value : SourceFile [ "id" ] ) { this . redirect . redirectTarget . id = value ; } ,
1609
1609
} ,
1610
1610
symbol : {
1611
- get ( this : SourceFile ) { return this . redirect . redirectTo . symbol ; } ,
1612
- set ( this : SourceFile , value : SourceFile [ "symbol" ] ) { this . redirect . redirectTo . symbol = value ; } ,
1611
+ get ( this : SourceFile ) { return this . redirect . redirectTarget . symbol ; } ,
1612
+ set ( this : SourceFile , value : SourceFile [ "symbol" ] ) { this . redirect . redirectTarget . symbol = value ; } ,
1613
1613
} ,
1614
1614
} ) ;
1615
1615
return redirect ;
@@ -1666,7 +1666,7 @@ namespace ts {
1666
1666
// Some other SourceFile already exists with this package name and version.
1667
1667
// Instead of creating a duplicate, just redirect to the existing one.
1668
1668
const dupFile = createRedirectSourceFile ( fileFromPackageId , file , fileName , path ) ;
1669
- isSourceFileTargetOfRedirect . set ( fileFromPackageId . path , true ) ;
1669
+ redirectTargetsSet . set ( fileFromPackageId . path , true ) ;
1670
1670
filesByName . set ( path , dupFile ) ;
1671
1671
sourceFileToPackageName . set ( path , packageId . name ) ;
1672
1672
files . push ( dupFile ) ;
0 commit comments