Skip to content

Commit 341811a

Browse files
committed
fix #4218
1 parent a9d7722 commit 341811a

File tree

4 files changed

+16
-40
lines changed

4 files changed

+16
-40
lines changed

jscomp/core/js_name_of_module_id.ml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,6 @@
2525
let (=) (x : int) (y:float) = assert false
2626
*)
2727

28-
(* "xx/lib/ocaml/js.cmj"
29-
Enhancement: This can be delegated to build system
30-
*)
31-
let runtime_package_path : string Lazy.t =
32-
lazy (Filename.dirname (Filename.dirname
33-
(Filename.dirname
34-
(match Config_util.find_opt "js.cmj" with
35-
| None -> assert false
36-
| Some x -> x))))
3728

3829
let (//) = Filename.concat
3930

@@ -83,7 +74,10 @@ let get_runtime_module_path
8374
current_package_info
8475
~package_dir:(Lazy.force Ext_path.package_dir)
8576
module_system )
86-
(Lazy.force runtime_package_path // dep_path // js_file)
77+
(*Invariant: the package path to bs-platform, it is used to
78+
calculate relative js path
79+
*)
80+
((Filename.dirname (Filename.dirname Sys.executable_name)) // dep_path // js_file)
8781

8882

8983

lib/4.06.1/unstable/js_compiler.ml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -388699,15 +388699,6 @@ end = struct
388699388699
let (=) (x : int) (y:float) = assert false
388700388700
*)
388701388701

388702-
(* "xx/lib/ocaml/js.cmj"
388703-
Enhancement: This can be delegated to build system
388704-
*)
388705-
let runtime_package_path : string Lazy.t =
388706-
lazy (Filename.dirname (Filename.dirname
388707-
(Filename.dirname
388708-
(match Config_util.find_opt "js.cmj" with
388709-
| None -> assert false
388710-
| Some x -> x))))
388711388702

388712388703
let (//) = Filename.concat
388713388704

@@ -388757,7 +388748,10 @@ let get_runtime_module_path
388757388748
current_package_info
388758388749
~package_dir:(Lazy.force Ext_path.package_dir)
388759388750
module_system )
388760-
(Lazy.force runtime_package_path // dep_path // js_file)
388751+
(*Invariant: the package path to bs-platform, it is used to
388752+
calculate relative js path
388753+
*)
388754+
((Filename.dirname (Filename.dirname Sys.executable_name)) // dep_path // js_file)
388761388755

388762388756

388763388757

lib/4.06.1/unstable/js_refmt_compiler.ml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -388699,15 +388699,6 @@ end = struct
388699388699
let (=) (x : int) (y:float) = assert false
388700388700
*)
388701388701

388702-
(* "xx/lib/ocaml/js.cmj"
388703-
Enhancement: This can be delegated to build system
388704-
*)
388705-
let runtime_package_path : string Lazy.t =
388706-
lazy (Filename.dirname (Filename.dirname
388707-
(Filename.dirname
388708-
(match Config_util.find_opt "js.cmj" with
388709-
| None -> assert false
388710-
| Some x -> x))))
388711388702

388712388703
let (//) = Filename.concat
388713388704

@@ -388757,7 +388748,10 @@ let get_runtime_module_path
388757388748
current_package_info
388758388749
~package_dir:(Lazy.force Ext_path.package_dir)
388759388750
module_system )
388760-
(Lazy.force runtime_package_path // dep_path // js_file)
388751+
(*Invariant: the package path to bs-platform, it is used to
388752+
calculate relative js path
388753+
*)
388754+
((Filename.dirname (Filename.dirname Sys.executable_name)) // dep_path // js_file)
388761388755

388762388756

388763388757

lib/4.06.1/whole_compiler.ml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -382745,15 +382745,6 @@ end = struct
382745382745
let (=) (x : int) (y:float) = assert false
382746382746
*)
382747382747

382748-
(* "xx/lib/ocaml/js.cmj"
382749-
Enhancement: This can be delegated to build system
382750-
*)
382751-
let runtime_package_path : string Lazy.t =
382752-
lazy (Filename.dirname (Filename.dirname
382753-
(Filename.dirname
382754-
(match Config_util.find_opt "js.cmj" with
382755-
| None -> assert false
382756-
| Some x -> x))))
382757382748

382758382749
let (//) = Filename.concat
382759382750

@@ -382803,7 +382794,10 @@ let get_runtime_module_path
382803382794
current_package_info
382804382795
~package_dir:(Lazy.force Ext_path.package_dir)
382805382796
module_system )
382806-
(Lazy.force runtime_package_path // dep_path // js_file)
382797+
(*Invariant: the package path to bs-platform, it is used to
382798+
calculate relative js path
382799+
*)
382800+
((Filename.dirname (Filename.dirname Sys.executable_name)) // dep_path // js_file)
382807382801

382808382802

382809382803

0 commit comments

Comments
 (0)