File tree Expand file tree Collapse file tree 2 files changed +25
-21
lines changed Expand file tree Collapse file tree 2 files changed +25
-21
lines changed Original file line number Diff line number Diff line change 2525let (=) (x : int) (y:float) = assert false
2626*)
2727
28+ #ifdef BROWSER
29+
30+ let string_of_module_id_in_browser (x : Lam_module_ident.t ) =
31+ match x.kind with
32+ | External {name} -> name
33+ | Runtime | Ml ->
34+ " ./stdlib/" ^ Ext_string. uncapitalize_ascii x.id.name ^ " .js"
2835
36+ let string_of_module_id
37+ (id : Lam_module_ident.t )
38+ ~output_dir :(_ :string )
39+ (_module_system : Js_packages_info.module_system )
40+ = string_of_module_id_in_browser id
41+
42+ #else
43+
2944let (// ) = Filename. concat
3045
3146
@@ -87,8 +102,6 @@ let get_runtime_module_path
87102 path // dep_path // js_file
88103 )
89104
90-
91-
92105(* [output_dir] is decided by the command line argument *)
93106let string_of_module_id
94107 (dep_module_id : Lam_module_ident.t )
@@ -187,18 +200,4 @@ let string_of_module_id
187200 | None ->
188201 Bs_exception. error (Js_not_found js_file))
189202
190-
191-
192- (* Override it in browser *)
193- #ifdef BROWSER
194- let string_of_module_id_in_browser (x : Lam_module_ident.t ) =
195- match x.kind with
196- | External {name} -> name
197- | Runtime | Ml ->
198- " ./stdlib/" ^ Ext_string. uncapitalize_ascii x.id.name ^ " .js"
199- let string_of_module_id
200- (id : Lam_module_ident.t )
201- ~output_dir :(_ :string )
202- (_module_system : Js_packages_info.module_system )
203- = string_of_module_id_in_browser id
204- #endif
203+ #endif
Original file line number Diff line number Diff line change 1313(* *)
1414(* *************************************************************************)
1515
16- open Cmi_format
16+ #ifdef BROWSER
17+ [@@@ warning " -32" ]
18+ #endif
19+
1720open Typedtree
1821
1922(* Note that in Typerex, there is an awful hack to save a cmt file
@@ -164,10 +167,12 @@ let record_value_dependency vd1 vd2 =
164167 if vd1.Types. val_loc <> vd2.Types. val_loc then
165168 value_deps := (vd1, vd2) :: ! value_deps
166169
167- let save_cmt filename modname binary_annots sourcefile initial_env cmi =
168170#ifdef BROWSER
169- ()
170- #else
171+ let save_cmt _filename _modname _binary_annots _sourcefile _initial_env _cmi = ()
172+ #else
173+ open Cmi_format
174+
175+ let save_cmt filename modname binary_annots sourcefile initial_env cmi =
171176 if ! Clflags. binary_annotations then begin
172177 (if ! Config. bs_only then Misc. output_to_bin_file_directly else
173178 Misc. output_to_file_via_temporary
You can’t perform that action at this time.
0 commit comments