Skip to content

Commit f04b1d7

Browse files
committed
Tweak names
1 parent c9b63e1 commit f04b1d7

File tree

5 files changed

+66
-69
lines changed

5 files changed

+66
-69
lines changed

jscomp/core/js_cmj_load.ml

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -26,33 +26,35 @@
2626
If not installed, use the distributed [cmj] files,
2727
make sure that the distributed files are platform independent
2828
*)
29-
let find_cmj file : string * Js_cmj_format.t =
29+
30+
31+
32+
#if BS_COMPILER_IN_BROWSER then
33+
let find_cmj_exn file : string * Js_cmj_format.t =
34+
let target = Ext_string.uncapitalize_ascii (Filename.basename file) in
35+
match String_map.find_exn !Js_cmj_datasets.data_sets target with
36+
| v
37+
->
38+
begin match Lazy.force v with
39+
| exception _
40+
->
41+
Ext_log.warn __LOC__
42+
"@[%s corrupted in database, when looking %s while compiling %s please update @]" file target !Location.input_name ;
43+
Bs_exception.error (Cmj_not_found file)
44+
| v -> "BROWSER", v
45+
(* see {!Js_packages_info.string_of_module_id} *)
46+
end
47+
| exception Not_found
48+
->
49+
Bs_exception.error (Cmj_not_found file)
50+
#else
51+
let find_cmj_exn file : string * Js_cmj_format.t =
3052
match Config_util.find_opt file with
3153
| Some f
3254
->
3355
f, Js_cmj_format.from_file f
3456
| None ->
3557
(* ONLY read the stored cmj data in browser environment *)
36-
#if BS_COMPILER_IN_BROWSER then
37-
"BROWSER", (
38-
let target = Ext_string.uncapitalize_ascii (Filename.basename file) in
39-
match String_map.find_exn !Js_cmj_datasets.data_sets target with
40-
| v
41-
->
42-
begin match Lazy.force v with
43-
| exception _
44-
->
45-
Ext_log.warn __LOC__
46-
"@[%s corrupted in database, when looking %s while compiling %s please update @]" file target !Location.input_name ;
47-
Js_cmj_format.no_pure_dummy; (* FIXME *)
48-
| v -> v
49-
(* see {!Js_packages_info.string_of_module_id} *)
50-
end
51-
| exception Not_found
52-
->
53-
Ext_log.warn __LOC__ "@[%s not found @]" file ;
54-
Js_cmj_format.no_pure_dummy )
55-
#else
56-
Bs_exception.error (Cmj_not_found file)
57-
#end
58+
Bs_exception.error (Cmj_not_found file)
5859

60+
#end

jscomp/core/js_cmj_load.mli

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@
3030

3131

3232
(** return path and meta data *)
33-
val find_cmj : string -> string * Js_cmj_format.t
33+
val find_cmj_exn : string -> string * Js_cmj_format.t

jscomp/core/lam_compile_env.ml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ let cached_find_ml_id_pos (module_id : Ident.t) name : ident_info =
125125
match Lam_module_ident.Hash.find_opt cached_tbl oid with
126126
| None ->
127127
let cmj_path, cmj_table =
128-
Js_cmj_load.find_cmj (module_id.name ^ Literals.suffix_cmj) in
128+
Js_cmj_load.find_cmj_exn (module_id.name ^ Literals.suffix_cmj) in
129129
oid +> Visit { cmj_table ; cmj_path } ;
130130
let arity, closed_lambda =
131131
Js_cmj_format.query_by_name cmj_table name
@@ -174,7 +174,7 @@ let query_and_add_if_not_exist
174174
begin match oid.kind with
175175
| Runtime ->
176176
let (cmj_path, cmj_table) as cmj_info =
177-
Js_cmj_load.find_cmj (Lam_module_ident.name oid ^ Literals.suffix_cmj) in
177+
Js_cmj_load.find_cmj_exn (Lam_module_ident.name oid ^ Literals.suffix_cmj) in
178178
oid +> Runtime (true,cmj_path,cmj_table) ;
179179
(match env with
180180
| Has_env _ ->
@@ -184,7 +184,7 @@ let query_and_add_if_not_exist
184184
| Ml
185185
->
186186
let (cmj_path, cmj_table) as cmj_info =
187-
Js_cmj_load.find_cmj (Lam_module_ident.name oid ^ Literals.suffix_cmj) in
187+
Js_cmj_load.find_cmj_exn (Lam_module_ident.name oid ^ Literals.suffix_cmj) in
188188
( match env with
189189
| Has_env env ->
190190
begin match
@@ -257,7 +257,7 @@ let get_package_path_from_cmj
257257
| External _ -> assert false
258258
| Ml ->
259259
let (cmj_path, cmj_table) =
260-
Js_cmj_load.find_cmj (Lam_module_ident.name id ^ Literals.suffix_cmj) in
260+
Js_cmj_load.find_cmj_exn (Lam_module_ident.name id ^ Literals.suffix_cmj) in
261261
id +> Visit {cmj_table;cmj_path };
262262
(cmj_path,
263263
Js_cmj_format.get_npm_package_path cmj_table,

lib/4.02.3/unstable/js_compiler.ml

Lines changed: 25 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -86970,7 +86970,7 @@ module Js_cmj_load : sig
8697086970

8697186971

8697286972
(** return path and meta data *)
86973-
val find_cmj : string -> string * Js_cmj_format.t
86973+
val find_cmj_exn : string -> string * Js_cmj_format.t
8697486974

8697586975
end = struct
8697686976
#1 "js_cmj_load.ml"
@@ -87002,35 +87002,28 @@ end = struct
8700287002
If not installed, use the distributed [cmj] files,
8700387003
make sure that the distributed files are platform independent
8700487004
*)
87005-
let find_cmj file : string * Js_cmj_format.t =
87006-
match Config_util.find_opt file with
87007-
| Some f
87008-
->
87009-
f, Js_cmj_format.from_file f
87010-
| None ->
87011-
(* ONLY read the stored cmj data in browser environment *)
87012-
87013-
"BROWSER", (
87014-
let target = Ext_string.uncapitalize_ascii (Filename.basename file) in
87015-
match String_map.find_exn !Js_cmj_datasets.data_sets target with
87016-
| v
87017-
->
87018-
begin match Lazy.force v with
87019-
| exception _
87020-
->
87021-
Ext_log.warn __LOC__
87022-
"@[%s corrupted in database, when looking %s while compiling %s please update @]" file target !Location.input_name ;
87023-
Js_cmj_format.no_pure_dummy; (* FIXME *)
87024-
| v -> v
87025-
(* see {!Js_packages_info.string_of_module_id} *)
87026-
end
87027-
| exception Not_found
87028-
->
87029-
Ext_log.warn __LOC__ "@[%s not found @]" file ;
87030-
Js_cmj_format.no_pure_dummy )
87031-
8703287005

8703387006

87007+
87008+
87009+
let find_cmj_exn file : string * Js_cmj_format.t =
87010+
let target = Ext_string.uncapitalize_ascii (Filename.basename file) in
87011+
match String_map.find_exn !Js_cmj_datasets.data_sets target with
87012+
| v
87013+
->
87014+
begin match Lazy.force v with
87015+
| exception _
87016+
->
87017+
Ext_log.warn __LOC__
87018+
"@[%s corrupted in database, when looking %s while compiling %s please update @]" file target !Location.input_name ;
87019+
Bs_exception.error (Cmj_not_found file)
87020+
| v -> "BROWSER", v
87021+
(* see {!Js_packages_info.string_of_module_id} *)
87022+
end
87023+
| exception Not_found
87024+
->
87025+
Bs_exception.error (Cmj_not_found file)
87026+
8703487027
end
8703587028
module Hash_set : sig
8703687029
#1 "hash_set.mli"
@@ -96704,7 +96697,7 @@ let cached_find_ml_id_pos (module_id : Ident.t) name : ident_info =
9670496697
match Lam_module_ident.Hash.find_opt cached_tbl oid with
9670596698
| None ->
9670696699
let cmj_path, cmj_table =
96707-
Js_cmj_load.find_cmj (module_id.name ^ Literals.suffix_cmj) in
96700+
Js_cmj_load.find_cmj_exn (module_id.name ^ Literals.suffix_cmj) in
9670896701
oid +> Visit { cmj_table ; cmj_path } ;
9670996702
let arity, closed_lambda =
9671096703
Js_cmj_format.query_by_name cmj_table name
@@ -96753,7 +96746,7 @@ let query_and_add_if_not_exist
9675396746
begin match oid.kind with
9675496747
| Runtime ->
9675596748
let (cmj_path, cmj_table) as cmj_info =
96756-
Js_cmj_load.find_cmj (Lam_module_ident.name oid ^ Literals.suffix_cmj) in
96749+
Js_cmj_load.find_cmj_exn (Lam_module_ident.name oid ^ Literals.suffix_cmj) in
9675796750
oid +> Runtime (true,cmj_path,cmj_table) ;
9675896751
(match env with
9675996752
| Has_env _ ->
@@ -96763,7 +96756,7 @@ let query_and_add_if_not_exist
9676396756
| Ml
9676496757
->
9676596758
let (cmj_path, cmj_table) as cmj_info =
96766-
Js_cmj_load.find_cmj (Lam_module_ident.name oid ^ Literals.suffix_cmj) in
96759+
Js_cmj_load.find_cmj_exn (Lam_module_ident.name oid ^ Literals.suffix_cmj) in
9676796760
( match env with
9676896761
| Has_env env ->
9676996762
begin match
@@ -96836,7 +96829,7 @@ let get_package_path_from_cmj
9683696829
| External _ -> assert false
9683796830
| Ml ->
9683896831
let (cmj_path, cmj_table) =
96839-
Js_cmj_load.find_cmj (Lam_module_ident.name id ^ Literals.suffix_cmj) in
96832+
Js_cmj_load.find_cmj_exn (Lam_module_ident.name id ^ Literals.suffix_cmj) in
9684096833
id +> Visit {cmj_table;cmj_path };
9684196834
(cmj_path,
9684296835
Js_cmj_format.get_npm_package_path cmj_table,

lib/4.02.3/whole_compiler.ml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -67995,7 +67995,7 @@ module Js_cmj_load : sig
6799567995

6799667996

6799767997
(** return path and meta data *)
67998-
val find_cmj : string -> string * Js_cmj_format.t
67998+
val find_cmj_exn : string -> string * Js_cmj_format.t
6799967999

6800068000
end = struct
6800168001
#1 "js_cmj_load.ml"
@@ -68027,16 +68027,18 @@ end = struct
6802768027
If not installed, use the distributed [cmj] files,
6802868028
make sure that the distributed files are platform independent
6802968029
*)
68030-
let find_cmj file : string * Js_cmj_format.t =
68030+
68031+
68032+
68033+
68034+
let find_cmj_exn file : string * Js_cmj_format.t =
6803168035
match Config_util.find_opt file with
6803268036
| Some f
6803368037
->
6803468038
f, Js_cmj_format.from_file f
6803568039
| None ->
6803668040
(* ONLY read the stored cmj data in browser environment *)
68037-
68038-
Bs_exception.error (Cmj_not_found file)
68039-
68041+
Bs_exception.error (Cmj_not_found file)
6804068042

6804168043

6804268044
end
@@ -84216,7 +84218,7 @@ let cached_find_ml_id_pos (module_id : Ident.t) name : ident_info =
8421684218
match Lam_module_ident.Hash.find_opt cached_tbl oid with
8421784219
| None ->
8421884220
let cmj_path, cmj_table =
84219-
Js_cmj_load.find_cmj (module_id.name ^ Literals.suffix_cmj) in
84221+
Js_cmj_load.find_cmj_exn (module_id.name ^ Literals.suffix_cmj) in
8422084222
oid +> Visit { cmj_table ; cmj_path } ;
8422184223
let arity, closed_lambda =
8422284224
Js_cmj_format.query_by_name cmj_table name
@@ -84265,7 +84267,7 @@ let query_and_add_if_not_exist
8426584267
begin match oid.kind with
8426684268
| Runtime ->
8426784269
let (cmj_path, cmj_table) as cmj_info =
84268-
Js_cmj_load.find_cmj (Lam_module_ident.name oid ^ Literals.suffix_cmj) in
84270+
Js_cmj_load.find_cmj_exn (Lam_module_ident.name oid ^ Literals.suffix_cmj) in
8426984271
oid +> Runtime (true,cmj_path,cmj_table) ;
8427084272
(match env with
8427184273
| Has_env _ ->
@@ -84275,7 +84277,7 @@ let query_and_add_if_not_exist
8427584277
| Ml
8427684278
->
8427784279
let (cmj_path, cmj_table) as cmj_info =
84278-
Js_cmj_load.find_cmj (Lam_module_ident.name oid ^ Literals.suffix_cmj) in
84280+
Js_cmj_load.find_cmj_exn (Lam_module_ident.name oid ^ Literals.suffix_cmj) in
8427984281
( match env with
8428084282
| Has_env env ->
8428184283
begin match
@@ -84348,7 +84350,7 @@ let get_package_path_from_cmj
8434884350
| External _ -> assert false
8434984351
| Ml ->
8435084352
let (cmj_path, cmj_table) =
84351-
Js_cmj_load.find_cmj (Lam_module_ident.name id ^ Literals.suffix_cmj) in
84353+
Js_cmj_load.find_cmj_exn (Lam_module_ident.name id ^ Literals.suffix_cmj) in
8435284354
id +> Visit {cmj_table;cmj_path };
8435384355
(cmj_path,
8435484356
Js_cmj_format.get_npm_package_path cmj_table,

0 commit comments

Comments
 (0)