Skip to content

Commit eff41b4

Browse files
committed
snapshot changes
1 parent f9b69c3 commit eff41b4

11 files changed

+55
-99
lines changed

lib/4.06.1/unstable/js_compiler.ml

+1-7
Original file line numberDiff line numberDiff line change
@@ -110723,8 +110723,6 @@ module Js_of_lam_exception : sig
110723110723
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)
110724110724

110725110725

110726-
val caml_set_oo_id :
110727-
J.expression list -> J.expression
110728110726

110729110727

110730110728
val make : J.expression -> J.expression
@@ -110778,10 +110776,6 @@ let make exception_str : J.expression =
110778110776

110779110777

110780110778

110781-
(* TODO: only used in camlinternalOO, split it off as a separate module? *)
110782-
let caml_set_oo_id args =
110783-
E.runtime_call Js_runtime_modules.exceptions "caml_set_oo_id" args
110784-
110785110779

110786110780
end
110787110781
module Lam_dispatch_primitive : sig
@@ -111417,7 +111411,7 @@ let translate loc (prim_name : string)
111417111411
call Js_runtime_modules.caml_js_exceptions
111418111412
| "caml_set_oo_id" (* needed in {!camlinternalOO.set_id} *)
111419111413
->
111420-
Js_of_lam_exception.caml_set_oo_id args
111414+
call Js_runtime_modules.oo
111421111415

111422111416
| "caml_sys_get_argv"
111423111417
(** TODO: refine

lib/4.06.1/unstable/js_refmt_compiler.ml

+1-7
Original file line numberDiff line numberDiff line change
@@ -110723,8 +110723,6 @@ module Js_of_lam_exception : sig
110723110723
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)
110724110724

110725110725

110726-
val caml_set_oo_id :
110727-
J.expression list -> J.expression
110728110726

110729110727

110730110728
val make : J.expression -> J.expression
@@ -110778,10 +110776,6 @@ let make exception_str : J.expression =
110778110776

110779110777

110780110778

110781-
(* TODO: only used in camlinternalOO, split it off as a separate module? *)
110782-
let caml_set_oo_id args =
110783-
E.runtime_call Js_runtime_modules.exceptions "caml_set_oo_id" args
110784-
110785110779

110786110780
end
110787110781
module Lam_dispatch_primitive : sig
@@ -111417,7 +111411,7 @@ let translate loc (prim_name : string)
111417111411
call Js_runtime_modules.caml_js_exceptions
111418111412
| "caml_set_oo_id" (* needed in {!camlinternalOO.set_id} *)
111419111413
->
111420-
Js_of_lam_exception.caml_set_oo_id args
111414+
call Js_runtime_modules.oo
111421111415

111422111416
| "caml_sys_get_argv"
111423111417
(** TODO: refine

lib/4.06.1/whole_compiler.ml

+1-7
Original file line numberDiff line numberDiff line change
@@ -393312,8 +393312,6 @@ module Js_of_lam_exception : sig
393312393312
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)
393313393313

393314393314

393315-
val caml_set_oo_id :
393316-
J.expression list -> J.expression
393317393315

393318393316

393319393317
val make : J.expression -> J.expression
@@ -393367,10 +393365,6 @@ let make exception_str : J.expression =
393367393365

393368393366

393369393367

393370-
(* TODO: only used in camlinternalOO, split it off as a separate module? *)
393371-
let caml_set_oo_id args =
393372-
E.runtime_call Js_runtime_modules.exceptions "caml_set_oo_id" args
393373-
393374393368

393375393369
end
393376393370
module Lam_dispatch_primitive : sig
@@ -394006,7 +394000,7 @@ let translate loc (prim_name : string)
394006394000
call Js_runtime_modules.caml_js_exceptions
394007394001
| "caml_set_oo_id" (* needed in {!camlinternalOO.set_id} *)
394008394002
->
394009-
Js_of_lam_exception.caml_set_oo_id args
394003+
call Js_runtime_modules.oo
394010394004

394011394005
| "caml_sys_get_argv"
394012394006
(** TODO: refine

lib/es6/caml_exceptions.js

+1-7
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,6 @@ var id = {
55
contents: 0
66
};
77

8-
function caml_set_oo_id(b) {
9-
b[1] = id.contents;
10-
id.contents = id.contents + 1 | 0;
11-
return b;
12-
}
13-
148
function create(str) {
159
id.contents = id.contents + 1 | 0;
1610
return str + ("/" + id.contents);
@@ -29,7 +23,7 @@ function caml_exn_slot_name(x) {
2923
}
3024

3125
export {
32-
caml_set_oo_id ,
26+
id ,
3327
create ,
3428
caml_is_extension ,
3529
caml_exn_slot_name ,

lib/es6/caml_hash.js

+13-27
Original file line numberDiff line numberDiff line change
@@ -62,35 +62,21 @@ function caml_hash(count, _limit, seed, obj) {
6262
} else if (typeof obj$1 === "string") {
6363
hash = Caml_hash_primitive.caml_hash_mix_string(hash, obj$1);
6464
num = num - 1 | 0;
65-
} else if (typeof obj$1 !== "boolean" && typeof obj$1 !== "undefined") {
66-
if (typeof obj$1 === "symbol") {
67-
throw {
68-
RE_EXN_ID: "Assert_failure",
69-
_1: /* tuple */[
70-
"caml_hash.ml",
71-
128,
72-
8
73-
],
74-
Error: new Error()
75-
};
76-
}
77-
if (typeof obj$1 !== "function") {
78-
var size = obj$1.length;
79-
if (size !== undefined) {
80-
var obj_tag = obj$1.tag | 0;
81-
var tag = (size << 10) | obj_tag;
82-
if (tag === 248) {
83-
hash = Caml_hash_primitive.caml_hash_mix_int(hash, obj$1[1]);
84-
} else {
85-
hash = Caml_hash_primitive.caml_hash_mix_int(hash, tag);
86-
var v = size - 1 | 0;
87-
var block = v < num ? v : num;
88-
for(var i = 0; i <= block; ++i){
89-
push_back(queue, obj$1[i]);
90-
}
65+
} else if (typeof obj$1 !== "boolean" && typeof obj$1 !== "undefined" && typeof obj$1 !== "symbol" && typeof obj$1 !== "function") {
66+
var size = obj$1.length;
67+
if (size !== undefined) {
68+
var obj_tag = obj$1.tag | 0;
69+
var tag = (size << 10) | obj_tag;
70+
if (tag === 248) {
71+
hash = Caml_hash_primitive.caml_hash_mix_int(hash, obj$1[1]);
72+
} else {
73+
hash = Caml_hash_primitive.caml_hash_mix_int(hash, tag);
74+
var v = size - 1 | 0;
75+
var block = v < num ? v : num;
76+
for(var i = 0; i <= block; ++i){
77+
push_back(queue, obj$1[i]);
9178
}
9279
}
93-
9480
}
9581

9682
}

lib/es6/caml_oo.js

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
11

22

33
import * as Caml_array from "./caml_array.js";
4+
import * as Caml_exceptions from "./caml_exceptions.js";
45

56
var caml_methods_cache = Caml_array.caml_make_vect(1000, 0);
67

8+
function caml_set_oo_id(b) {
9+
b[1] = Caml_exceptions.id.contents;
10+
Caml_exceptions.id.contents = Caml_exceptions.id.contents + 1 | 0;
11+
return b;
12+
}
13+
714
function caml_get_public_method(obj, tag, cacheid) {
815
var meths = obj[0];
916
var offs = caml_methods_cache[cacheid];
@@ -18,7 +25,7 @@ function caml_get_public_method(obj, tag, cacheid) {
1825
RE_EXN_ID: "Assert_failure",
1926
_1: /* tuple */[
2027
"caml_oo.ml",
21-
62,
28+
80,
2229
20
2330
],
2431
Error: new Error()
@@ -37,6 +44,7 @@ function caml_get_public_method(obj, tag, cacheid) {
3744

3845
export {
3946
caml_get_public_method ,
47+
caml_set_oo_id ,
4048

4149
}
4250
/* No side effect */

lib/es6/camlinternalOO.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,10 @@ import * as Caml_array from "./caml_array.js";
99
import * as Belt_MapInt from "./belt_MapInt.js";
1010
import * as Caml_string from "./caml_string.js";
1111
import * as Belt_MapString from "./belt_MapString.js";
12-
import * as Caml_exceptions from "./caml_exceptions.js";
1312
import * as Caml_js_exceptions from "./caml_js_exceptions.js";
1413

1514
function copy(o) {
16-
return Caml_exceptions.caml_set_oo_id(Caml_obj.caml_obj_dup(o));
15+
return Caml_oo.caml_set_oo_id(Caml_obj.caml_obj_dup(o));
1716
}
1817

1918
var params = {
@@ -366,7 +365,7 @@ function make_class_store(pub_meths, class_init, init_table) {
366365
function create_object(table) {
367366
var obj = Caml_obj.caml_obj_block(248, table.size);
368367
obj[0] = table.methods;
369-
return Caml_exceptions.caml_set_oo_id(obj);
368+
return Caml_oo.caml_set_oo_id(obj);
370369
}
371370

372371
function create_object_opt(obj_0, table) {
@@ -375,7 +374,7 @@ function create_object_opt(obj_0, table) {
375374
}
376375
var obj = Caml_obj.caml_obj_block(248, table.size);
377376
obj[0] = table.methods;
378-
return Caml_exceptions.caml_set_oo_id(obj);
377+
return Caml_oo.caml_set_oo_id(obj);
379378
}
380379

381380
function iter_f(obj, _param) {

lib/js/caml_exceptions.js

+1-7
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,6 @@ var id = {
55
contents: 0
66
};
77

8-
function caml_set_oo_id(b) {
9-
b[1] = id.contents;
10-
id.contents = id.contents + 1 | 0;
11-
return b;
12-
}
13-
148
function create(str) {
159
id.contents = id.contents + 1 | 0;
1610
return str + ("/" + id.contents);
@@ -28,7 +22,7 @@ function caml_exn_slot_name(x) {
2822
return x.RE_EXN_ID;
2923
}
3024

31-
exports.caml_set_oo_id = caml_set_oo_id;
25+
exports.id = id;
3226
exports.create = create;
3327
exports.caml_is_extension = caml_is_extension;
3428
exports.caml_exn_slot_name = caml_exn_slot_name;

lib/js/caml_hash.js

+13-27
Original file line numberDiff line numberDiff line change
@@ -62,35 +62,21 @@ function caml_hash(count, _limit, seed, obj) {
6262
} else if (typeof obj$1 === "string") {
6363
hash = Caml_hash_primitive.caml_hash_mix_string(hash, obj$1);
6464
num = num - 1 | 0;
65-
} else if (typeof obj$1 !== "boolean" && typeof obj$1 !== "undefined") {
66-
if (typeof obj$1 === "symbol") {
67-
throw {
68-
RE_EXN_ID: "Assert_failure",
69-
_1: /* tuple */[
70-
"caml_hash.ml",
71-
128,
72-
8
73-
],
74-
Error: new Error()
75-
};
76-
}
77-
if (typeof obj$1 !== "function") {
78-
var size = obj$1.length;
79-
if (size !== undefined) {
80-
var obj_tag = obj$1.tag | 0;
81-
var tag = (size << 10) | obj_tag;
82-
if (tag === 248) {
83-
hash = Caml_hash_primitive.caml_hash_mix_int(hash, obj$1[1]);
84-
} else {
85-
hash = Caml_hash_primitive.caml_hash_mix_int(hash, tag);
86-
var v = size - 1 | 0;
87-
var block = v < num ? v : num;
88-
for(var i = 0; i <= block; ++i){
89-
push_back(queue, obj$1[i]);
90-
}
65+
} else if (typeof obj$1 !== "boolean" && typeof obj$1 !== "undefined" && typeof obj$1 !== "symbol" && typeof obj$1 !== "function") {
66+
var size = obj$1.length;
67+
if (size !== undefined) {
68+
var obj_tag = obj$1.tag | 0;
69+
var tag = (size << 10) | obj_tag;
70+
if (tag === 248) {
71+
hash = Caml_hash_primitive.caml_hash_mix_int(hash, obj$1[1]);
72+
} else {
73+
hash = Caml_hash_primitive.caml_hash_mix_int(hash, tag);
74+
var v = size - 1 | 0;
75+
var block = v < num ? v : num;
76+
for(var i = 0; i <= block; ++i){
77+
push_back(queue, obj$1[i]);
9178
}
9279
}
93-
9480
}
9581

9682
}

lib/js/caml_oo.js

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
11
'use strict';
22

33
var Caml_array = require("./caml_array.js");
4+
var Caml_exceptions = require("./caml_exceptions.js");
45

56
var caml_methods_cache = Caml_array.caml_make_vect(1000, 0);
67

8+
function caml_set_oo_id(b) {
9+
b[1] = Caml_exceptions.id.contents;
10+
Caml_exceptions.id.contents = Caml_exceptions.id.contents + 1 | 0;
11+
return b;
12+
}
13+
714
function caml_get_public_method(obj, tag, cacheid) {
815
var meths = obj[0];
916
var offs = caml_methods_cache[cacheid];
@@ -18,7 +25,7 @@ function caml_get_public_method(obj, tag, cacheid) {
1825
RE_EXN_ID: "Assert_failure",
1926
_1: /* tuple */[
2027
"caml_oo.ml",
21-
62,
28+
80,
2229
20
2330
],
2431
Error: new Error()
@@ -36,4 +43,5 @@ function caml_get_public_method(obj, tag, cacheid) {
3643
}
3744

3845
exports.caml_get_public_method = caml_get_public_method;
46+
exports.caml_set_oo_id = caml_set_oo_id;
3947
/* No side effect */

lib/js/camlinternalOO.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,10 @@ var Caml_array = require("./caml_array.js");
99
var Belt_MapInt = require("./belt_MapInt.js");
1010
var Caml_string = require("./caml_string.js");
1111
var Belt_MapString = require("./belt_MapString.js");
12-
var Caml_exceptions = require("./caml_exceptions.js");
1312
var Caml_js_exceptions = require("./caml_js_exceptions.js");
1413

1514
function copy(o) {
16-
return Caml_exceptions.caml_set_oo_id(Caml_obj.caml_obj_dup(o));
15+
return Caml_oo.caml_set_oo_id(Caml_obj.caml_obj_dup(o));
1716
}
1817

1918
var params = {
@@ -366,7 +365,7 @@ function make_class_store(pub_meths, class_init, init_table) {
366365
function create_object(table) {
367366
var obj = Caml_obj.caml_obj_block(248, table.size);
368367
obj[0] = table.methods;
369-
return Caml_exceptions.caml_set_oo_id(obj);
368+
return Caml_oo.caml_set_oo_id(obj);
370369
}
371370

372371
function create_object_opt(obj_0, table) {
@@ -375,7 +374,7 @@ function create_object_opt(obj_0, table) {
375374
}
376375
var obj = Caml_obj.caml_obj_block(248, table.size);
377376
obj[0] = table.methods;
378-
return Caml_exceptions.caml_set_oo_id(obj);
377+
return Caml_oo.caml_set_oo_id(obj);
379378
}
380379

381380
function iter_f(obj, _param) {

0 commit comments

Comments
 (0)