Skip to content

Commit afceff2

Browse files
committed
tweak: minor semantics changed (for Runtime, we still consult cmj_table instead of giving a true directly)
1 parent fbae812 commit afceff2

File tree

3 files changed

+15
-51
lines changed

3 files changed

+15
-51
lines changed

jscomp/core/lam_compile_env.ml

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -166,11 +166,7 @@ let query_and_add_if_not_exist
166166
let (cmj_path, cmj_table) as cmj_info =
167167
Js_cmj_load.find_cmj_exn (Lam_module_ident.name oid ^ Literals.suffix_cmj) in
168168
oid +> Runtime {cmj_path;cmj_table} ;
169-
(match env with
170-
| Has_env _ ->
171-
found true
172-
| No_env ->
173-
found (Js_cmj_format.is_pure cmj_table))
169+
found (Js_cmj_format.is_pure cmj_table)
174170
| Ml
175171
->
176172
let (cmj_path, cmj_table) as cmj_info =
@@ -185,9 +181,7 @@ let query_and_add_if_not_exist
185181
found (Js_cmj_format.is_pure cmj_table)
186182
end
187183
| No_env ->
188-
found (Js_cmj_format.is_pure cmj_table))
189-
190-
184+
found (Js_cmj_format.is_pure cmj_table))
191185
| External _ ->
192186
oid +> External;
193187
(** This might be wrong, if we happen to expand an js module
@@ -196,15 +190,9 @@ let query_and_add_if_not_exist
196190
*)
197191
found false
198192
end
199-
| Some (Ml { cmj_table; cmj_path}) ->
200-
found (Js_cmj_format.is_pure cmj_table)
201-
| Some (Runtime {cmj_path; cmj_table}) ->
202-
begin match env with
203-
| Has_env _ ->
204-
found true
205-
| No_env ->
206-
found (Js_cmj_format.is_pure cmj_table)
207-
end
193+
| Some (Ml { cmj_table })
194+
| Some (Runtime {cmj_table}) ->
195+
found (Js_cmj_format.is_pure cmj_table)
208196
| Some External -> found false
209197

210198

lib/4.02.3/unstable/js_compiler.ml

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -96746,11 +96746,7 @@ let query_and_add_if_not_exist
9674696746
let (cmj_path, cmj_table) as cmj_info =
9674796747
Js_cmj_load.find_cmj_exn (Lam_module_ident.name oid ^ Literals.suffix_cmj) in
9674896748
oid +> Runtime {cmj_path;cmj_table} ;
96749-
(match env with
96750-
| Has_env _ ->
96751-
found true
96752-
| No_env ->
96753-
found (Js_cmj_format.is_pure cmj_table))
96749+
found (Js_cmj_format.is_pure cmj_table)
9675496750
| Ml
9675596751
->
9675696752
let (cmj_path, cmj_table) as cmj_info =
@@ -96765,9 +96761,7 @@ let query_and_add_if_not_exist
9676596761
found (Js_cmj_format.is_pure cmj_table)
9676696762
end
9676796763
| No_env ->
96768-
found (Js_cmj_format.is_pure cmj_table))
96769-
96770-
96764+
found (Js_cmj_format.is_pure cmj_table))
9677196765
| External _ ->
9677296766
oid +> External;
9677396767
(** This might be wrong, if we happen to expand an js module
@@ -96776,15 +96770,9 @@ let query_and_add_if_not_exist
9677696770
*)
9677796771
found false
9677896772
end
96779-
| Some (Ml { cmj_table; cmj_path}) ->
96780-
found (Js_cmj_format.is_pure cmj_table)
96781-
| Some (Runtime {cmj_path; cmj_table}) ->
96782-
begin match env with
96783-
| Has_env _ ->
96784-
found true
96785-
| No_env ->
96786-
found (Js_cmj_format.is_pure cmj_table)
96787-
end
96773+
| Some (Ml { cmj_table })
96774+
| Some (Runtime {cmj_table}) ->
96775+
found (Js_cmj_format.is_pure cmj_table)
9678896776
| Some External -> found false
9678996777

9679096778

lib/4.02.3/whole_compiler.ml

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -84267,11 +84267,7 @@ let query_and_add_if_not_exist
8426784267
let (cmj_path, cmj_table) as cmj_info =
8426884268
Js_cmj_load.find_cmj_exn (Lam_module_ident.name oid ^ Literals.suffix_cmj) in
8426984269
oid +> Runtime {cmj_path;cmj_table} ;
84270-
(match env with
84271-
| Has_env _ ->
84272-
found true
84273-
| No_env ->
84274-
found (Js_cmj_format.is_pure cmj_table))
84270+
found (Js_cmj_format.is_pure cmj_table)
8427584271
| Ml
8427684272
->
8427784273
let (cmj_path, cmj_table) as cmj_info =
@@ -84286,9 +84282,7 @@ let query_and_add_if_not_exist
8428684282
found (Js_cmj_format.is_pure cmj_table)
8428784283
end
8428884284
| No_env ->
84289-
found (Js_cmj_format.is_pure cmj_table))
84290-
84291-
84285+
found (Js_cmj_format.is_pure cmj_table))
8429284286
| External _ ->
8429384287
oid +> External;
8429484288
(** This might be wrong, if we happen to expand an js module
@@ -84297,15 +84291,9 @@ let query_and_add_if_not_exist
8429784291
*)
8429884292
found false
8429984293
end
84300-
| Some (Ml { cmj_table; cmj_path}) ->
84301-
found (Js_cmj_format.is_pure cmj_table)
84302-
| Some (Runtime {cmj_path; cmj_table}) ->
84303-
begin match env with
84304-
| Has_env _ ->
84305-
found true
84306-
| No_env ->
84307-
found (Js_cmj_format.is_pure cmj_table)
84308-
end
84294+
| Some (Ml { cmj_table })
84295+
| Some (Runtime {cmj_table}) ->
84296+
found (Js_cmj_format.is_pure cmj_table)
8430984297
| Some External -> found false
8431084298

8431184299

0 commit comments

Comments
 (0)