@@ -206,8 +206,8 @@ let buckle_script_flags : (string * Arg.spec * string) list =
206
206
" Define conditional variable e.g, -D DEBUG=true"
207
207
)
208
208
::
209
- (" -bs-quiet " , Arg. Unit ( fun _ -> () ) ,
210
- " (Deprecated using -w a) Quiet mode (no warnings printed) "
209
+ (" -bs-unsafe-empty-array " , Arg. Clear Js_config. mono_empty_array ,
210
+ " Allow [||] to be polymorphic "
211
211
)
212
212
::
213
213
(" -nostdlib" , Arg. Set Js_config. no_stdlib,
@@ -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 ->
0 commit comments