File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -357,14 +357,15 @@ let buckle_script_flags : (string * Arg.spec * string) list =
357
357
let file_level_flags_handler (e : Parsetree.expression option ) =
358
358
match e with
359
359
| None -> ()
360
- | Some {pexp_desc = Pexp_array args } ->
360
+ | Some {pexp_desc = Pexp_array args ; pexp_loc } ->
361
361
let args = Array. of_list
362
362
(Sys. executable_name :: Ext_list. map args (fun e ->
363
363
match e.pexp_desc with
364
364
| Pexp_constant (Pconst_string(name ,_ )) -> name
365
365
| _ -> Location. raise_errorf ~loc: e.pexp_loc " string literal expected" )) in
366
- Arg. parse_argv ~current: (ref 0 )
366
+ ( try Arg. parse_argv ~current: (ref 0 )
367
367
args buckle_script_flags ignore usage
368
+ with _ -> Location. prerr_warning pexp_loc (Preprocessor " invalid flags for bsc" ))
368
369
(* ;Format.fprintf Format.err_formatter "%a %b@."
369
370
Ext_obj.pp_any args !Js_config.cross_module_inline; *)
370
371
| Some e ->
Original file line number Diff line number Diff line change @@ -420763,14 +420763,15 @@ let buckle_script_flags : (string * Arg.spec * string) list =
420763
420763
let file_level_flags_handler (e : Parsetree.expression option) =
420764
420764
match e with
420765
420765
| None -> ()
420766
- | Some {pexp_desc = Pexp_array args } ->
420766
+ | Some {pexp_desc = Pexp_array args ; pexp_loc } ->
420767
420767
let args = Array.of_list
420768
420768
(Sys.executable_name :: Ext_list.map args (fun e ->
420769
420769
match e.pexp_desc with
420770
420770
| Pexp_constant (Pconst_string(name,_)) -> name
420771
420771
| _ -> Location.raise_errorf ~loc:e.pexp_loc "string literal expected" )) in
420772
- Arg.parse_argv ~current:(ref 0)
420772
+ (try Arg.parse_argv ~current:(ref 0)
420773
420773
args buckle_script_flags ignore usage
420774
+ with _ -> Location.prerr_warning pexp_loc (Preprocessor "invalid flags for bsc"))
420774
420775
(* ;Format.fprintf Format.err_formatter "%a %b@."
420775
420776
Ext_obj.pp_any args !Js_config.cross_module_inline; *)
420776
420777
| Some e ->
You can’t perform that action at this time.
0 commit comments