@@ -153,12 +153,15 @@ type _ t =
153
153
| Has_env : Env .t -> bool t (* Indicate it is pure or not *)
154
154
155
155
156
- (* -FIXME:
157
- Here [not_found] only means cmi not found, not cmj not found *)
156
+ (*
157
+ FIXME:
158
+ Here [not_found] only means cmi not found, not cmj not found
159
+ We do need handle cases when [not_found] hit in a graceful way
160
+ *)
158
161
let query_and_add_if_not_exist
159
162
(type u )
160
163
(oid : Lam_module_ident.t )
161
- (env : u t ) ~ not_found ~(found : bool -> _ ) =
164
+ (env : u t ) ~(found : bool -> _ ) =
162
165
match Lam_module_ident.Hash. find_opt cached_tbl oid with
163
166
| None ->
164
167
begin match oid.kind with
@@ -171,17 +174,8 @@ let query_and_add_if_not_exist
171
174
->
172
175
let (cmj_path, cmj_table) as cmj_info =
173
176
Js_cmj_load. find_cmj_exn (Lam_module_ident. name oid ^ Literals. suffix_cmj) in
174
- ( match env with
175
- | Has_env env ->
176
- begin match
177
- Ocaml_types. find_serializable_signatures_by_path oid.id env with
178
- | None -> not_found () (* actually when [not_found] in the call site, we throw... *)
179
- | Some _ ->
180
- oid +> Ml {cmj_table;cmj_path } ;
181
- found (Js_cmj_format. is_pure cmj_table)
182
- end
183
- | No_env ->
184
- found (Js_cmj_format. is_pure cmj_table))
177
+ oid +> Ml {cmj_table;cmj_path } ;
178
+ found (Js_cmj_format. is_pure cmj_table)
185
179
| External _ ->
186
180
oid +> External ;
187
181
(* * This might be wrong, if we happen to expand an js module
@@ -247,7 +241,6 @@ let add = Lam_module_ident.Hash_set.add
247
241
let is_pure_module (id : Lam_module_ident.t ) =
248
242
id.kind = Runtime ||
249
243
query_and_add_if_not_exist id No_env
250
- ~not_found: (fun _ -> false )
251
244
~found: (fun x -> x)
252
245
253
246
let get_required_modules
0 commit comments