Skip to content

Commit f1dbf90

Browse files
committed
Toss the System out
1 parent e4af02b commit f1dbf90

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/compiler/commandLineParser.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -374,10 +374,10 @@ namespace ts {
374374
* Read tsconfig.json file
375375
* @param fileName The path to the config file
376376
*/
377-
export function readConfigFile(fileName: string, system: System): { config?: any; error?: Diagnostic } {
377+
export function readConfigFile(fileName: string, readFile: (path: string) => string): { config?: any; error?: Diagnostic } {
378378
let text = "";
379379
try {
380-
text = system.readFile(fileName);
380+
text = readFile(fileName);
381381
}
382382
catch (e) {
383383
return { error: createCompilerDiagnostic(Diagnostics.Cannot_read_file_0_Colon_1, fileName, e.message) };

src/compiler/tsc.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ namespace ts {
216216
if (!cachedProgram) {
217217
if (configFileName) {
218218

219-
let result = readConfigFile(configFileName, sys);
219+
let result = readConfigFile(configFileName, sys.readFile);
220220
if (result.error) {
221221
reportDiagnostic(result.error);
222222
return sys.exit(ExitStatus.DiagnosticsPresent_OutputsSkipped);

0 commit comments

Comments
 (0)