@@ -171,7 +171,7 @@ namespace ts {
171
171
const readFileCache = new Map < string , string | false > ( ) ;
172
172
const fileExistsCache = new Map < string , boolean > ( ) ;
173
173
const directoryExistsCache = new Map < string , boolean > ( ) ;
174
- const sourceFileCache = new Map < string , ESMap < SourceFile [ "impliedNodeFormat" ] , SourceFile > > ( ) ;
174
+ const sourceFileCache = new Map < string , SourceFile > ( ) ;
175
175
176
176
const readFileWithCache = ( fileName : string ) : string | undefined => {
177
177
const key = toPath ( fileName ) ;
@@ -196,16 +196,14 @@ namespace ts {
196
196
return setReadFileCache ( key , fileName ) ;
197
197
} ;
198
198
199
- const getSourceFileWithCache : CompilerHost [ "getSourceFile" ] | undefined = getSourceFile ? ( fileName , languageVersionOrOptions , onError , shouldCreateNewSourceFile ) => {
199
+ const getSourceFileWithCache : CompilerHost [ "getSourceFile" ] | undefined = getSourceFile ? ( fileName , languageVersion , onError , shouldCreateNewSourceFile ) => {
200
200
const key = toPath ( fileName ) ;
201
- const impliedNodeFormat : SourceFile [ "impliedNodeFormat" ] = typeof languageVersionOrOptions === "object" ? languageVersionOrOptions . impliedNodeFormat : undefined ;
202
- const forPath = sourceFileCache . get ( key ) ;
203
- const value = forPath ?. get ( impliedNodeFormat ) ;
201
+ const value = sourceFileCache . get ( key ) ;
204
202
if ( value ) return value ;
205
203
206
- const sourceFile = getSourceFile ( fileName , languageVersionOrOptions , onError , shouldCreateNewSourceFile ) ;
204
+ const sourceFile = getSourceFile ( fileName , languageVersion , onError , shouldCreateNewSourceFile ) ;
207
205
if ( sourceFile && ( isDeclarationFileName ( fileName ) || fileExtensionIs ( fileName , Extension . Json ) ) ) {
208
- sourceFileCache . set ( key , ( forPath || new Map ( ) ) . set ( impliedNodeFormat , sourceFile ) ) ;
206
+ sourceFileCache . set ( key , sourceFile ) ;
209
207
}
210
208
return sourceFile ;
211
209
} : undefined ;
@@ -230,8 +228,7 @@ namespace ts {
230
228
sourceFileCache . delete ( key ) ;
231
229
}
232
230
else if ( getSourceFileWithCache ) {
233
- const sourceFileMap = sourceFileCache . get ( key ) ;
234
- const sourceFile = sourceFileMap && firstDefinedIterator ( sourceFileMap . values ( ) , identity ) ;
231
+ const sourceFile = sourceFileCache . get ( key ) ;
235
232
if ( sourceFile && sourceFile . text !== data ) {
236
233
sourceFileCache . delete ( key ) ;
237
234
}
0 commit comments