@@ -152,10 +152,7 @@ namespace ts {
152
152
153
153
const newLine = getNewLineCharacter ( options ) ;
154
154
155
- let moduleResolutionHost : ModuleResolutionHost = {
156
- fileExists : fileName => sys . fileExists ( fileName ) ,
157
- }
158
-
155
+
159
156
return {
160
157
getSourceFile,
161
158
getDefaultLibFileName : options => combinePaths ( getDirectoryPath ( normalizePath ( sys . getExecutingFilePath ( ) ) ) , getDefaultLibFileName ( options ) ) ,
@@ -164,7 +161,8 @@ namespace ts {
164
161
useCaseSensitiveFileNames : ( ) => sys . useCaseSensitiveFileNames ,
165
162
getCanonicalFileName,
166
163
getNewLine : ( ) => newLine ,
167
- getModuleResolutionHost : ( ) => moduleResolutionHost
164
+ fileExists : fileName => sys . fileExists ( fileName ) ,
165
+ readFile : fileName => sys . readFile ( fileName )
168
166
} ;
169
167
}
170
168
@@ -228,11 +226,10 @@ namespace ts {
228
226
if ( ! options . noResolve ) {
229
227
resolveModuleNamesWorker = host . resolveModuleNames ;
230
228
if ( ! resolveModuleNamesWorker ) {
231
- Debug . assert ( host . getModuleResolutionHost !== undefined ) ;
232
229
let defaultResolver = getDefaultModuleNameResolver ( options ) ;
233
230
resolveModuleNamesWorker = ( moduleNames , containingFile ) => {
234
231
return map ( moduleNames , moduleName => {
235
- let moduleResolution = defaultResolver ( moduleName , containingFile , options , host . getModuleResolutionHost ( ) ) ;
232
+ let moduleResolution = defaultResolver ( moduleName , containingFile , options , host ) ;
236
233
return moduleResolution . resolvedFileName ;
237
234
} ) ;
238
235
}
@@ -248,7 +245,8 @@ namespace ts {
248
245
if ( ( oldOptions . module !== options . module ) ||
249
246
( oldOptions . noResolve !== options . noResolve ) ||
250
247
( oldOptions . target !== options . target ) ||
251
- ( oldOptions . noLib !== options . noLib ) ) {
248
+ ( oldOptions . noLib !== options . noLib ) ||
249
+ ( oldOptions . jsx !== options . jsx ) ) {
252
250
oldProgram = undefined ;
253
251
}
254
252
}
0 commit comments