@@ -479,7 +479,7 @@ namespace ts {
479479 // Maps from a SourceFile's `.path` to the name of the package it was imported with.
480480 let sourceFileToPackageName = createMap < string > ( ) ;
481481 // See `sourceFileIsRedirectedTo`.
482- let isSourceFileTargetOfRedirect = createMap < true > ( ) ;
482+ let redirectTargetsSet = createMap < true > ( ) ;
483483
484484 const filesByName = createMap < SourceFile | undefined > ( ) ;
485485 // stores 'filename -> file association' ignoring case
@@ -558,7 +558,7 @@ namespace ts {
558558 dropDiagnosticsProducingTypeChecker,
559559 getSourceFileFromReference,
560560 sourceFileToPackageName,
561- isSourceFileTargetOfRedirect ,
561+ redirectTargetsSet ,
562562 } ;
563563
564564 verifyCompilerOptions ( ) ;
@@ -797,12 +797,12 @@ namespace ts {
797797 if ( oldSourceFile . redirect ) {
798798 // We got `newSourceFile` by path, so it is actually for the underlying file.
799799 // 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 ) {
801801 // Underlying file has changed. Might not redirect anymore. Must rebuild program.
802802 return oldProgram . structureIsReused = StructureIsReused . Not ;
803803 }
804804 }
805- else if ( oldProgram . isSourceFileTargetOfRedirect . has ( oldSourceFile . path ) ) {
805+ else if ( oldProgram . redirectTargetsSet . has ( oldSourceFile . path ) ) {
806806 // This is similar to the above case. If a redirected-to source file changes, the redirect may be broken.
807807 if ( newSourceFile !== oldSourceFile ) {
808808 return oldProgram . structureIsReused = StructureIsReused . Not ;
@@ -941,7 +941,7 @@ namespace ts {
941941 resolvedTypeReferenceDirectives = oldProgram . getResolvedTypeReferenceDirectives ( ) ;
942942
943943 sourceFileToPackageName = oldProgram . sourceFileToPackageName ;
944- isSourceFileTargetOfRedirect = oldProgram . isSourceFileTargetOfRedirect ;
944+ redirectTargetsSet = oldProgram . redirectTargetsSet ;
945945
946946 return oldProgram . structureIsReused = StructureIsReused . Completely ;
947947 }
@@ -1597,19 +1597,19 @@ namespace ts {
15971597 }
15981598 }
15991599
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 ) ;
16021602 redirect . fileName = fileName ;
16031603 redirect . path = path ;
1604- redirect . redirect = { redirectTo , underlying } ;
1604+ redirect . redirect = { redirectTarget , unredirected } ;
16051605 Object . defineProperties ( redirect , {
16061606 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 ; } ,
16091609 } ,
16101610 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 ; } ,
16131613 } ,
16141614 } ) ;
16151615 return redirect ;
@@ -1666,7 +1666,7 @@ namespace ts {
16661666 // Some other SourceFile already exists with this package name and version.
16671667 // Instead of creating a duplicate, just redirect to the existing one.
16681668 const dupFile = createRedirectSourceFile ( fileFromPackageId , file , fileName , path ) ;
1669- isSourceFileTargetOfRedirect . set ( fileFromPackageId . path , true ) ;
1669+ redirectTargetsSet . set ( fileFromPackageId . path , true ) ;
16701670 filesByName . set ( path , dupFile ) ;
16711671 sourceFileToPackageName . set ( path , packageId . name ) ;
16721672 files . push ( dupFile ) ;
0 commit comments