@@ -76016,8 +76016,7 @@ val get_cmj_case :
76016
76016
cmj_case
76017
76017
76018
76018
val single_na : arity
76019
- val pure_dummy : t
76020
- val no_pure_dummy : t
76019
+
76021
76020
76022
76021
76023
76022
val from_file : string -> t
@@ -76104,21 +76103,7 @@ let cmj_magic_number = "BUCKLE20171012"
76104
76103
let cmj_magic_number_length =
76105
76104
String.length cmj_magic_number
76106
76105
76107
- let pure_dummy =
76108
- {
76109
- values = empty_values;
76110
- pure = true;
76111
- npm_package_path = Js_packages_info.empty;
76112
- cmj_case = Little_js;
76113
- }
76114
76106
76115
- let no_pure_dummy =
76116
- {
76117
- values = empty_values;
76118
- pure = false;
76119
- npm_package_path = Js_packages_info.empty;
76120
- cmj_case = Little_js; (** TODO: consistent with Js_config.bs_suffix default *)
76121
- }
76122
76107
76123
76108
let digest_length = 16 (*16 chars *)
76124
76109
@@ -96600,42 +96585,7 @@ type _ t =
96600
96585
| Has_env : Env.t -> bool t (* Indicate it is pure or not *)
96601
96586
96602
96587
96603
- (*
96604
- FIXME:
96605
- Here [not_found] only means cmi not found, not cmj not found
96606
- We do need handle cases when [not_found] hit in a graceful way
96607
- *)
96608
- let query_and_add_if_not_exist
96609
- (type u)
96610
- (oid : Lam_module_ident.t)
96611
- =
96612
- match Lam_module_ident.Hash.find_opt cached_tbl oid with
96613
- | None ->
96614
- begin match oid.kind with
96615
- | Runtime ->
96616
- let (cmj_path, cmj_table) as cmj_info =
96617
- Js_cmj_load.find_cmj_exn (Lam_module_ident.name oid ^ Literals.suffix_cmj) in
96618
- oid +> Runtime {cmj_path;cmj_table} ;
96619
- Js_cmj_format.is_pure cmj_table
96620
- | Ml
96621
- ->
96622
- let (cmj_path, cmj_table) as cmj_info =
96623
- Js_cmj_load.find_cmj_exn (Lam_module_ident.name oid ^ Literals.suffix_cmj) in
96624
- oid +> Ml {cmj_table;cmj_path } ;
96625
- Js_cmj_format.is_pure cmj_table
96626
- | External _ ->
96627
- oid +> External;
96628
- (** This might be wrong, if we happen to expand an js module
96629
- we should assert false (but this in general should not happen)
96630
- FIXME: #154, it come from External, should be okay
96631
- *)
96632
- false
96633
- end
96634
- | Some (Ml { cmj_table })
96635
- | Some (Runtime {cmj_table}) ->
96636
- Js_cmj_format.is_pure cmj_table
96637
- | Some External -> false
96638
-
96588
+
96639
96589
96640
96590
96641
96591
@@ -96671,10 +96621,23 @@ let get_package_path_from_cmj
96671
96621
let add = Lam_module_ident.Hash_set.add
96672
96622
96673
96623
96624
+
96674
96625
(* Conservative interface *)
96675
- let is_pure_module (id : Lam_module_ident.t) =
96676
- id.kind = Runtime ||
96677
- query_and_add_if_not_exist id
96626
+ let is_pure_module (oid : Lam_module_ident.t) =
96627
+ match oid.kind with
96628
+ | Runtime -> true
96629
+ | External _ -> false
96630
+ | Ml ->
96631
+ begin match Lam_module_ident.Hash.find_opt cached_tbl oid with
96632
+ | None ->
96633
+ let (cmj_path, cmj_table) =
96634
+ Js_cmj_load.find_cmj_exn (Lam_module_ident.name oid ^ Literals.suffix_cmj) in
96635
+ oid +> Ml {cmj_table;cmj_path } ;
96636
+ Js_cmj_format.is_pure cmj_table
96637
+ | Some (Ml{cmj_table}|Runtime {cmj_table}) ->
96638
+ Js_cmj_format.is_pure cmj_table
96639
+ | Some External -> false
96640
+ end
96678
96641
96679
96642
96680
96643
let get_required_modules
0 commit comments