Skip to content

Commit 3bacd37

Browse files
committed
more work
1 parent 45ee7d6 commit 3bacd37

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

jscomp/core/js_embeds.ml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ let write_embeds ~extension_points ~output ast =
2424
let iterator = {Ast_iterator.default_iterator with extension} in
2525
iterator.structure iterator ast;
2626
match !content with
27-
| [] -> ()
27+
| [] -> false
2828
| content ->
2929
let text =
3030
content
@@ -36,4 +36,5 @@ let write_embeds ~extension_points ~output ast =
3636
in
3737
let oc = open_out_bin output in
3838
output_string oc text;
39-
close_out oc
39+
close_out oc;
40+
true

jscomp/core/js_implementation.ml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -127,13 +127,17 @@ let no_export (rest : Parsetree.structure) : Parsetree.structure =
127127
]
128128
| _ -> rest
129129

130-
let write_embeds outputprefix (ast : Parsetree.structure) =
131-
if !Clflags.only_parse = false && !Js_config.binary_ast then (
132-
match !Js_config.embeds with
133-
| [] -> ()
134-
| embeds -> Js_embeds.write_embeds ~extension_points:embeds
135-
~output:(outputprefix ^ Literals.suffix_embeds)
136-
ast);
130+
let write_embeds outputprefix (ast : Parsetree.structure) =
131+
(if !Clflags.only_parse = false && !Js_config.binary_ast then
132+
let wrote_embeds =
133+
match !Js_config.embeds with
134+
| [] -> false
135+
| embeds ->
136+
Js_embeds.write_embeds ~extension_points:embeds
137+
~output:(outputprefix ^ Literals.suffix_embeds)
138+
ast
139+
in
140+
if wrote_embeds then print_endline "1" else print_endline "0");
137141
ast
138142

139143
let after_parsing_impl ppf outputprefix (ast : Parsetree.structure) =

0 commit comments

Comments
 (0)