Skip to content

Commit 3e1a574

Browse files
committed
refactoring
1 parent 41c029f commit 3e1a574

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

jscomp/core/lam_compile_main.ml

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -254,20 +254,17 @@ let compile
254254
|> Js_shake.shake_program
255255
|> _j "shake"
256256
|> ( fun (program: J.program) ->
257-
let external_module_ids =
258-
Lam_compile_env.get_required_modules
259-
may_required_modules
260-
(Js_fold_basic.calculate_hard_dependencies program.block)
261-
|>
262-
(fun x ->
263-
if !Js_config.sort_imports then
264-
Ext_list.sort_via_array x
265-
(fun id1 id2 ->
266-
Ext_string.compare (Lam_module_ident.name id1) (Lam_module_ident.name id2)
267-
)
268-
else
269-
x
270-
)
257+
let external_module_ids : Lam_module_ident.t list =
258+
let x = Lam_compile_env.get_required_modules
259+
may_required_modules
260+
(Js_fold_basic.calculate_hard_dependencies program.block) in
261+
if !Js_config.sort_imports then
262+
Ext_list.sort_via_array x
263+
(fun id1 id2 ->
264+
Ext_string.compare (Lam_module_ident.name id1) (Lam_module_ident.name id2)
265+
)
266+
else
267+
x
271268
in
272269
Warnings.check_fatal ();
273270
let effect =

jscomp/core/lam_convert.ml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,10 @@ let prim = Lam.prim
161161
type required_modules = Lam_module_ident.Hash_set.t
162162

163163

164-
(** drop Lseq (List! ) etc *)
164+
(** drop Lseq (List! ) etc
165+
see #3852, we drop all these required global modules
166+
but added it back based on our own module analysis
167+
*)
165168
let rec drop_global_marker (lam : Lam.t) =
166169
match lam with
167170
| Lsequence (Lglobal_module id, rest) ->

0 commit comments

Comments
 (0)