Skip to content

Commit 9b9bc23

Browse files
committed
fix regression in unit test
1 parent d1ec093 commit 9b9bc23

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/fsharp/fsc.fs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ let AdjustForScriptCompile(tcConfigB:TcConfigBuilder,commandLineSourceFiles,lexR
246246

247247
List.rev !allSources
248248

249-
let ProcessCommandLineFlags (tcConfigB: TcConfigBuilder, argv) =
249+
let ProcessCommandLineFlags (tcConfigB: TcConfigBuilder, setProcessThreadLocals, lcidFromCodePage, argv) =
250250
let inputFilesRef = ref ([] : string list)
251251
let collect name =
252252
let lower = String.lowercase name
@@ -261,6 +261,13 @@ let ProcessCommandLineFlags (tcConfigB: TcConfigBuilder, argv) =
261261
ParseCompilerOptions (collect, GetCoreFscCompilerOptions tcConfigB, List.tail (PostProcessCompilerArgs abbrevArgs argv))
262262
let inputFiles = List.rev !inputFilesRef
263263

264+
// Check if we have a codepage from the console
265+
match tcConfigB.lcid with
266+
| Some _ -> ()
267+
| None -> tcConfigB.lcid <- lcidFromCodePage
268+
269+
setProcessThreadLocals(tcConfigB)
270+
264271
(* step - get dll references *)
265272
let dllFiles,sourceFiles = List.partition Filename.isDll inputFiles
266273
match dllFiles with
@@ -311,17 +318,10 @@ let GetTcImportsFromCommandLine
311318
// The ParseCompilerOptions function calls imperative function to process "real" args
312319
// Rather than start processing, just collect names, then process them.
313320
try
314-
let sourceFiles = ProcessCommandLineFlags (tcConfigB, argv)
321+
let sourceFiles = ProcessCommandLineFlags (tcConfigB, setProcessThreadLocals, lcidFromCodePage, argv)
315322

316323
let sourceFiles = AdjustForScriptCompile(tcConfigB,sourceFiles,lexResourceManager)
317324

318-
// Check if we have a codepage from the console
319-
match tcConfigB.lcid with
320-
| Some _ -> ()
321-
| None -> tcConfigB.lcid <- lcidFromCodePage
322-
323-
setProcessThreadLocals(tcConfigB)
324-
325325
sourceFiles
326326

327327
with e ->

src/fsharp/fsc.fsi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ type ILResource with
3030
member internal Bytes : byte[]
3131

3232
/// Proccess the given set of command line arguments
33-
val internal ProcessCommandLineFlags : TcConfigBuilder * argv:string[] -> string list
33+
val internal ProcessCommandLineFlags : TcConfigBuilder * setProcessThreadLocals:(TcConfigBuilder -> unit) * lcidFromCodePage : int option * argv:string[] -> string list
3434

3535
//---------------------------------------------------------------------------
3636
// The entry point used by fsc.exe

0 commit comments

Comments
 (0)