We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 67f3982 commit a2d3b4fCopy full SHA for a2d3b4f
runtime/nat.js
@@ -12,8 +12,12 @@ function initialize_nat() {
12
//Provides: MlNat
13
function MlNat(x){
14
this.data = new Int32Array(x);
15
+ // For num < 1.5
16
// length_nat isn't external, so we have to make the Obj.size
- // work out right. The +2 to array length seems to work.
17
+ // work out right.
18
+ // We add +2 to the array length:
19
+ // - +1 for the tag
20
+ // - +1 for the custom_ops slot
21
this.length = this.data.length + 2
22
}
23
@@ -30,6 +34,10 @@ function caml_hash_nat(x) {
30
34
return h;
31
35
32
36
37
+//Provides: length_nat
38
+function length_nat(x) {
39
+ return x.data.length;
40
+}
33
41
42
//Provides: nat_of_array
43
//Requires: MlNat
0 commit comments