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 25
25
let (=) (x : int) (y:float) = assert false
26
26
*)
27
27
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"
28
35
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
+
29
44
let (// ) = Filename. concat
30
45
31
46
@@ -87,8 +102,6 @@ let get_runtime_module_path
87
102
path // dep_path // js_file
88
103
)
89
104
90
-
91
-
92
105
(* [output_dir] is decided by the command line argument *)
93
106
let string_of_module_id
94
107
(dep_module_id : Lam_module_ident.t )
@@ -187,18 +200,4 @@ let string_of_module_id
187
200
| None ->
188
201
Bs_exception. error (Js_not_found js_file))
189
202
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 13
13
(* *)
14
14
(* *************************************************************************)
15
15
16
- open Cmi_format
16
+ #ifdef BROWSER
17
+ [@@@ warning " -32" ]
18
+ #endif
19
+
17
20
open Typedtree
18
21
19
22
(* Note that in Typerex, there is an awful hack to save a cmt file
@@ -164,10 +167,12 @@ let record_value_dependency vd1 vd2 =
164
167
if vd1.Types. val_loc <> vd2.Types. val_loc then
165
168
value_deps := (vd1, vd2) :: ! value_deps
166
169
167
- let save_cmt filename modname binary_annots sourcefile initial_env cmi =
168
170
#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 =
171
176
if ! Clflags. binary_annotations then begin
172
177
(if ! Config. bs_only then Misc. output_to_bin_file_directly else
173
178
Misc. output_to_file_via_temporary
You can’t perform that action at this time.
0 commit comments