@@ -76016,8 +76016,7 @@ val get_cmj_case :
7601676016 cmj_case
7601776017
7601876018val single_na : arity
76019- val pure_dummy : t
76020- val no_pure_dummy : t
76019+
7602176020
7602276021
7602376022val from_file : string -> t
@@ -76104,21 +76103,7 @@ let cmj_magic_number = "BUCKLE20171012"
7610476103let cmj_magic_number_length =
7610576104 String.length cmj_magic_number
7610676105
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- }
7611476106
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- }
7612276107
7612376108let digest_length = 16 (*16 chars *)
7612476109
@@ -96600,42 +96585,7 @@ type _ t =
9660096585 | Has_env : Env.t -> bool t (* Indicate it is pure or not *)
9660196586
9660296587
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+
9663996589
9664096590
9664196591
@@ -96671,10 +96621,23 @@ let get_package_path_from_cmj
9667196621let add = Lam_module_ident.Hash_set.add
9667296622
9667396623
96624+
9667496625(* 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
9667896641
9667996642
9668096643let get_required_modules
0 commit comments