Skip to content

Commit 579cb1b

Browse files
committed
refactoring
1 parent 2773c43 commit 579cb1b

File tree

3 files changed

+18
-12
lines changed

3 files changed

+18
-12
lines changed

jscomp/core/lam_compile_env.ml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ type ml_module_info = {
4141

4242
type env_value =
4343
| Visit of ml_module_info
44-
| Runtime of path * Js_cmj_format.t
44+
| Runtime of ml_module_info
4545
(**
4646
[Runtime (pure, path, cmj_format)]
4747
A built in module probably from our runtime primitives,
@@ -175,7 +175,7 @@ let query_and_add_if_not_exist
175175
| Runtime ->
176176
let (cmj_path, cmj_table) as cmj_info =
177177
Js_cmj_load.find_cmj_exn (Lam_module_ident.name oid ^ Literals.suffix_cmj) in
178-
oid +> Runtime (cmj_path,cmj_table) ;
178+
oid +> Runtime {cmj_path;cmj_table} ;
179179
(match env with
180180
| Has_env _ ->
181181
found { pure = true}
@@ -220,7 +220,7 @@ let query_and_add_if_not_exist
220220
| No_env -> found (cmj_path,cmj_table)
221221
end
222222

223-
| Some (Runtime (cmj_path,cmj_table)) ->
223+
| Some (Runtime {cmj_path; cmj_table}) ->
224224
begin match env with
225225
| Has_env _ ->
226226
found {pure = true}
@@ -246,7 +246,9 @@ let get_package_path_from_cmj
246246
(cmj_path,
247247
Js_cmj_format.get_npm_package_path cmj_table,
248248
Js_cmj_format.get_cmj_case cmj_table )
249-
| Some (External | Runtime _ ) ->
249+
| Some (
250+
External |
251+
Runtime _ ) ->
250252
assert false
251253
(* called by {!Js_name_of_module_id.string_of_module_id}
252254
can not be External

lib/4.02.3/unstable/js_compiler.ml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96613,7 +96613,7 @@ type ml_module_info = {
9661396613

9661496614
type env_value =
9661596615
| Visit of ml_module_info
96616-
| Runtime of path * Js_cmj_format.t
96616+
| Runtime of ml_module_info
9661796617
(**
9661896618
[Runtime (pure, path, cmj_format)]
9661996619
A built in module probably from our runtime primitives,
@@ -96747,7 +96747,7 @@ let query_and_add_if_not_exist
9674796747
| Runtime ->
9674896748
let (cmj_path, cmj_table) as cmj_info =
9674996749
Js_cmj_load.find_cmj_exn (Lam_module_ident.name oid ^ Literals.suffix_cmj) in
96750-
oid +> Runtime (cmj_path,cmj_table) ;
96750+
oid +> Runtime {cmj_path;cmj_table} ;
9675196751
(match env with
9675296752
| Has_env _ ->
9675396753
found { pure = true}
@@ -96792,7 +96792,7 @@ let query_and_add_if_not_exist
9679296792
| No_env -> found (cmj_path,cmj_table)
9679396793
end
9679496794

96795-
| Some (Runtime (cmj_path,cmj_table)) ->
96795+
| Some (Runtime {cmj_path; cmj_table}) ->
9679696796
begin match env with
9679796797
| Has_env _ ->
9679896798
found {pure = true}
@@ -96818,7 +96818,9 @@ let get_package_path_from_cmj
9681896818
(cmj_path,
9681996819
Js_cmj_format.get_npm_package_path cmj_table,
9682096820
Js_cmj_format.get_cmj_case cmj_table )
96821-
| Some (External | Runtime _ ) ->
96821+
| Some (
96822+
External |
96823+
Runtime _ ) ->
9682296824
assert false
9682396825
(* called by {!Js_name_of_module_id.string_of_module_id}
9682496826
can not be External

lib/4.02.3/whole_compiler.ml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84134,7 +84134,7 @@ type ml_module_info = {
8413484134

8413584135
type env_value =
8413684136
| Visit of ml_module_info
84137-
| Runtime of path * Js_cmj_format.t
84137+
| Runtime of ml_module_info
8413884138
(**
8413984139
[Runtime (pure, path, cmj_format)]
8414084140
A built in module probably from our runtime primitives,
@@ -84268,7 +84268,7 @@ let query_and_add_if_not_exist
8426884268
| Runtime ->
8426984269
let (cmj_path, cmj_table) as cmj_info =
8427084270
Js_cmj_load.find_cmj_exn (Lam_module_ident.name oid ^ Literals.suffix_cmj) in
84271-
oid +> Runtime (cmj_path,cmj_table) ;
84271+
oid +> Runtime {cmj_path;cmj_table} ;
8427284272
(match env with
8427384273
| Has_env _ ->
8427484274
found { pure = true}
@@ -84313,7 +84313,7 @@ let query_and_add_if_not_exist
8431384313
| No_env -> found (cmj_path,cmj_table)
8431484314
end
8431584315

84316-
| Some (Runtime (cmj_path,cmj_table)) ->
84316+
| Some (Runtime {cmj_path; cmj_table}) ->
8431784317
begin match env with
8431884318
| Has_env _ ->
8431984319
found {pure = true}
@@ -84339,7 +84339,9 @@ let get_package_path_from_cmj
8433984339
(cmj_path,
8434084340
Js_cmj_format.get_npm_package_path cmj_table,
8434184341
Js_cmj_format.get_cmj_case cmj_table )
84342-
| Some (External | Runtime _ ) ->
84342+
| Some (
84343+
External |
84344+
Runtime _ ) ->
8434384345
assert false
8434484346
(* called by {!Js_name_of_module_id.string_of_module_id}
8434584347
can not be External

0 commit comments

Comments
 (0)