Skip to content

Commit d3ce07a

Browse files
author
Hongbo Zhang
committed
get rid of dependency on camlinternalOO for camlinternalMod
1 parent 766c974 commit d3ce07a

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

jscomp/runtime/caml_module.ml

+6-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,12 @@ let init_mod (loc : string * int * int) (shape : CamlinternalMod.shape) =
3232
match shape with
3333
| Function -> struct_.(idx)<-(Obj.magic undef_module)
3434
| Lazy -> struct_.(idx)<- (Obj.magic (lazy undef_module))
35-
| Class -> struct_.(idx)<- (Obj.magic (CamlinternalOO.dummy_class loc))
35+
| Class ->
36+
struct_.(idx)<-
37+
(Obj.magic (*ref {!CamlinternalOO.dummy_class loc} *)
38+
(undef_module, undef_module, undef_module, 0)
39+
(* depends on dummy class representation *)
40+
)
3641
| Module comps
3742
->
3843
let v = (Obj.magic [||]) in

lib/js/caml_module.js

+8-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
var Caml_builtin_exceptions = require("./caml_builtin_exceptions");
55
var Caml_obj = require("./caml_obj");
6-
var CamlinternalOO = require("./camlinternalOO");
76

87
function init_mod(loc, shape) {
98
var undef_module = function () {
@@ -20,7 +19,12 @@ function init_mod(loc, shape) {
2019
struct_[idx] = undef_module;
2120
return /* () */0;
2221
case 2 :
23-
struct_[idx] = CamlinternalOO.dummy_class(loc);
22+
struct_[idx] = /* tuple */[
23+
undef_module,
24+
undef_module,
25+
undef_module,
26+
0
27+
];
2428
return /* () */0;
2529

2630
}
@@ -74,7 +78,7 @@ function update_mod(shape, o, n) {
7478
Caml_builtin_exceptions.assert_failure,
7579
[
7680
"caml_module.ml",
77-
74,
81+
79,
7882
10
7983
]
8084
];
@@ -84,7 +88,7 @@ function update_mod(shape, o, n) {
8488
Caml_builtin_exceptions.assert_failure,
8589
[
8690
"caml_module.ml",
87-
74,
91+
79,
8892
10
8993
]
9094
];

0 commit comments

Comments
 (0)