Skip to content

Commit 586b28b

Browse files
committed
fix jsoo_refmt_main, remove load_modules as it's not necessary anymore
1 parent 3c8e007 commit 586b28b

File tree

2 files changed

+1
-24
lines changed

2 files changed

+1
-24
lines changed

jscomp/main/jsoo_main.ml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -128,12 +128,6 @@ let make_compiler name impl =
128128
(fun _ code ->
129129
(compile impl ~use_super_errors:true (Js.to_string code)));
130130
"version", Js.Unsafe.inject (Js.string (Bs_version.version));
131-
"load_module",
132-
inject @@
133-
Js.wrap_meth_callback
134-
(fun _ cmi_path cmi_content cmj_path cmj_content ->
135-
Js.create_file cmi_path cmi_content;
136-
Js.create_file cmj_path cmj_content);
137131
|]))
138132
let () = make_compiler "ocaml" Parse.implementation
139133

jscomp/refmt/jsoo_refmt_main.ml

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -102,23 +102,15 @@ let implementation ~use_super_errors impl str : Js.Unsafe.obj =
102102
let compile ~use_super_errors impl =
103103
implementation ~use_super_errors impl
104104

105-
(* let load_module cmi_path cmi_content cmj_name cmj_content =
106-
Js.create_file cmi_path cmi_content;
107-
Js_cmj_datasets.data_sets :=
108-
Map_string.add !Js_cmj_datasets.data_sets
109-
cmj_name (lazy (Js_cmj_format.from_string cmj_content)) *)
110-
111105
let export (field : string) v =
112106
Js.Unsafe.set (Js.Unsafe.global) field v
113107
;;
114108

115109
(* To add a directory to the load path *)
116-
(*
117110
let dir_directory d =
118111
Config.load_path := d :: !Config.load_path
119-
120112
let () =
121-
dir_directory "/static/cmis" *)
113+
dir_directory "/static"
122114

123115
module Converter = Refmt_api.Migrate_parsetree.Convert(Refmt_api.Migrate_parsetree.OCaml_404)(Refmt_api.Migrate_parsetree.OCaml_406)
124116

@@ -139,15 +131,6 @@ let make_compiler ~name impl=
139131
(fun _ code ->
140132
(compile impl ~use_super_errors:true (Js.to_string code)));
141133
"version", Js.Unsafe.inject (Js.string (match name with | "reason" -> Refmt_api.version | _ -> Bs_version.version));
142-
(* "load_module",
143-
inject @@
144-
Js.wrap_meth_callback
145-
(fun _ cmi_path cmi_content cmj_name cmj_content ->
146-
let cmj_bytestring = Js.to_bytestring cmj_content in
147-
(* HACK: force string tag to ASCII (9) to avoid
148-
* UTF-8 encoding *)
149-
Js.Unsafe.set cmj_bytestring "t" 9;
150-
load_module cmi_path cmi_content (Js.to_string cmj_name) cmj_bytestring); *)
151134
|]))
152135

153136
let () = make_compiler ~name:"ocaml" Parse.implementation

0 commit comments

Comments
 (0)