|
@@ -2081,14 +2081,12 @@ let generate com =
|
|
|
|
|
|
List.iter (generate_enumMeta_fields ctx) com.types;
|
|
List.iter (generate_enumMeta_fields ctx) com.types;
|
|
|
|
|
|
- match com.main with
|
|
|
|
- | None -> ()
|
|
|
|
- | Some e ->
|
|
|
|
|
|
+ Option.may (fun e ->
|
|
spr ctx "_G.xpcall(";
|
|
spr ctx "_G.xpcall(";
|
|
(match e.eexpr with
|
|
(match e.eexpr with
|
|
- | TCall(e2,[]) ->
|
|
|
|
|
|
+ | TCall(e2,[]) ->
|
|
gen_value ctx e2;
|
|
gen_value ctx e2;
|
|
- | _->
|
|
|
|
|
|
+ | _->
|
|
let fn =
|
|
let fn =
|
|
{
|
|
{
|
|
tf_args = [];
|
|
tf_args = [];
|
|
@@ -2099,7 +2097,8 @@ let generate com =
|
|
gen_value ctx { e with eexpr = TFunction fn; etype = TFun ([],com.basic.tvoid) }
|
|
gen_value ctx { e with eexpr = TFunction fn; etype = TFun ([],com.basic.tvoid) }
|
|
);
|
|
);
|
|
spr ctx ", _hx_error)";
|
|
spr ctx ", _hx_error)";
|
|
- newline ctx;
|
|
|
|
|
|
+ newline ctx
|
|
|
|
+ ) com.main;
|
|
|
|
|
|
if anyExposed then
|
|
if anyExposed then
|
|
println ctx "return _hx_exports";
|
|
println ctx "return _hx_exports";
|