From 3598b906e344b5a2971a65cedb99536df3847292 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Thu, 27 Aug 2015 11:40:21 -0700 Subject: [PATCH] Add optional argument to readConfigFile Which allows the caller to specify the `System` used to read the file. --- src/compiler/commandLineParser.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index 1f57c142113..ece6471ee2f 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -374,10 +374,10 @@ namespace ts { * Read tsconfig.json file * @param fileName The path to the config file */ - export function readConfigFile(fileName: string): { config?: any; error?: Diagnostic } { + export function readConfigFile(fileName: string, system: System = sys): { config?: any; error?: Diagnostic } { let text = ""; try { - text = sys.readFile(fileName); + text = system.readFile(fileName); } catch (e) { return { error: createCompilerDiagnostic(Diagnostics.Cannot_read_file_0_Colon_1, fileName, e.message) };