Skip to content

Commit e83bcd8

Browse files
committed
snapshot js changes
1 parent 2bd95dd commit e83bcd8

File tree

95 files changed

+841
-799
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+841
-799
lines changed

jscomp/test/406_primitive_test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ function f(param) {
3838
}
3939
catch (raw_exn){
4040
var exn = Caml_js_exceptions.internalToOCamlException(raw_exn);
41-
if (exn.CamlExt === A) {
41+
if (exn.CamlExt.CamlId === A.CamlId) {
4242
return ;
4343
}
4444
throw exn;

jscomp/test/array_safe_get.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ try {
1616
}
1717
catch (raw_msg){
1818
var msg = Caml_js_exceptions.internalToOCamlException(raw_msg);
19-
if (msg.CamlExt === Caml_builtin_exceptions.invalid_argument) {
19+
if (msg.CamlExt.CamlId === Caml_builtin_exceptions.invalid_argument.CamlId) {
2020
console.log(msg._1);
2121
y = 0;
2222
} else {

jscomp/test/array_test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function starts_with(xs, prefix, p) {
3131
}
3232
catch (raw_exn){
3333
var exn = Caml_js_exceptions.internalToOCamlException(raw_exn);
34-
if (exn.CamlExt === H) {
34+
if (exn.CamlExt.CamlId === H.CamlId) {
3535
return false;
3636
}
3737
throw exn;

jscomp/test/caml_compare_test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ try {
1717
}
1818
catch (raw_exn){
1919
var exn = Caml_js_exceptions.internalToOCamlException(raw_exn);
20-
function_equal_test = exn.CamlExt === Caml_builtin_exceptions.invalid_argument && exn._1 === "equal: functional value" ? true : false;
20+
function_equal_test = exn.CamlExt.CamlId === Caml_builtin_exceptions.invalid_argument.CamlId && exn._1 === "equal: functional value" ? true : false;
2121
}
2222

2323
var suites = {

jscomp/test/caml_sys_poly_fill_test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ try {
5454
}
5555
catch (raw_exn){
5656
var exn = Caml_js_exceptions.internalToOCamlException(raw_exn);
57-
if (exn.CamlExt === Caml_builtin_exceptions.not_found) {
57+
if (exn.CamlExt.CamlId === Caml_builtin_exceptions.not_found.CamlId) {
5858
tmp = "Z";
5959
} else {
6060
throw exn;

jscomp/test/class_fib_open_recursion_test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ function memo_fib_init($$class) {
6565
}
6666
catch (raw_exn){
6767
var exn = Caml_js_exceptions.internalToOCamlException(raw_exn);
68-
if (exn.CamlExt === Caml_builtin_exceptions.not_found) {
68+
if (exn.CamlExt.CamlId === Caml_builtin_exceptions.not_found.CamlId) {
6969
var v = Curry._2(calc$1, self$2, x);
7070
Hashtbl.add(self$2[cache], x, v);
7171
return v;

jscomp/test/custom_error_test.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ function test_js_error(param) {
1111
}
1212
catch (raw_err){
1313
var err = Caml_js_exceptions.internalToOCamlException(raw_err);
14-
if (err.CamlExt === Js_exn.$$Error) {
14+
if (err.CamlExt.CamlId === Js_exn.$$Error.CamlId) {
1515
console.log(err._1.stack);
1616
return ;
1717
}
@@ -26,7 +26,7 @@ function test_js_error2(param) {
2626
}
2727
catch (raw_e){
2828
var e = Caml_js_exceptions.internalToOCamlException(raw_e);
29-
if (e.CamlExt === Js_exn.$$Error) {
29+
if (e.CamlExt.CamlId === Js_exn.$$Error.CamlId) {
3030
console.log(e._1.stack);
3131
throw e;
3232
}
@@ -41,7 +41,7 @@ function example1(param) {
4141
}
4242
catch (raw_err){
4343
var err = Caml_js_exceptions.internalToOCamlException(raw_err);
44-
if (err.CamlExt === Js_exn.$$Error) {
44+
if (err.CamlExt.CamlId === Js_exn.$$Error.CamlId) {
4545
console.log(err._1.stack);
4646
return ;
4747
}
@@ -56,7 +56,7 @@ function example2(param) {
5656
}
5757
catch (raw_exn){
5858
var exn = Caml_js_exceptions.internalToOCamlException(raw_exn);
59-
if (exn.CamlExt === Js_exn.$$Error) {
59+
if (exn.CamlExt.CamlId === Js_exn.$$Error.CamlId) {
6060
return ;
6161
}
6262
throw exn;

jscomp/test/equal_exception_test.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ function is_exception(param) {
5454
}
5555
catch (raw_exn){
5656
var exn = Caml_js_exceptions.internalToOCamlException(raw_exn);
57-
if (exn.CamlExt === Caml_builtin_exceptions.not_found) {
57+
if (exn.CamlExt.CamlId === Caml_builtin_exceptions.not_found.CamlId) {
5858
return ;
5959
}
6060
throw exn;
@@ -72,7 +72,7 @@ function is_normal_exception(_x) {
7272
}
7373
catch (raw_exn){
7474
var exn = Caml_js_exceptions.internalToOCamlException(raw_exn);
75-
if (exn.CamlExt === A) {
75+
if (exn.CamlExt.CamlId === A.CamlId) {
7676
if (exn._1 === 3) {
7777
return ;
7878
}
@@ -129,7 +129,7 @@ var e = {
129129
};
130130

131131
function eq(param) {
132-
return param.CamlExt === Caml_builtin_exceptions.not_found;
132+
return param.CamlExt.CamlId === Caml_builtin_exceptions.not_found.CamlId;
133133
}
134134

135135
var Not_found = Caml_exceptions.create("Equal_exception_test.Not_found");

jscomp/test/exception_def.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ var v = {
3838
};
3939

4040
Printexc.register_printer((function (s) {
41-
if (s.CamlExt === A) {
41+
if (s.CamlExt.CamlId === A.CamlId) {
4242
return "A";
4343
}
4444

jscomp/test/exception_raise_test.js

+11-11
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,20 @@ function appf(g, x) {
2525
}
2626
catch (raw_exn){
2727
var exn = Caml_js_exceptions.internalToOCamlException(raw_exn);
28-
if (exn.CamlExt === Local) {
28+
if (exn.CamlExt.CamlId === Local.CamlId) {
2929
return 3;
3030
}
31-
if (exn.CamlExt === Caml_builtin_exceptions.not_found) {
31+
if (exn.CamlExt.CamlId === Caml_builtin_exceptions.not_found.CamlId) {
3232
return 2;
3333
}
34-
if (exn.CamlExt === A) {
34+
if (exn.CamlExt.CamlId === A.CamlId) {
3535
exn._1 !== 32;
3636
return 3;
3737
}
38-
if (exn.CamlExt !== B) {
39-
if (exn.CamlExt === C) {
38+
if (exn.CamlExt.CamlId !== B.CamlId) {
39+
if (exn.CamlExt.CamlId === C.CamlId) {
4040
return exn._1;
41-
} else if (exn.CamlExt === D) {
41+
} else if (exn.CamlExt.CamlId === D.CamlId) {
4242
return exn._1[0];
4343
} else {
4444
return 4;
@@ -70,7 +70,7 @@ try {
7070
}
7171
catch (raw_x){
7272
var x = Caml_js_exceptions.internalToOCamlException(raw_x);
73-
f = x.CamlExt === A ? x._1 : 2;
73+
f = x.CamlExt.CamlId === A.CamlId ? x._1 : 2;
7474
}
7575

7676
var ff;
@@ -80,7 +80,7 @@ try {
8080
}
8181
catch (raw_x$1){
8282
var x$1 = Caml_js_exceptions.internalToOCamlException(raw_x$1);
83-
ff = x$1.CamlExt === A ? x$1._1 : 2;
83+
ff = x$1.CamlExt.CamlId === A.CamlId ? x$1._1 : 2;
8484
}
8585

8686
var fff;
@@ -90,7 +90,7 @@ try {
9090
}
9191
catch (raw_x$2){
9292
var x$2 = Caml_js_exceptions.internalToOCamlException(raw_x$2);
93-
fff = x$2.CamlExt === A ? x$2._1 : 2;
93+
fff = x$2.CamlExt.CamlId === A.CamlId ? x$2._1 : 2;
9494
}
9595

9696
var a0;
@@ -100,7 +100,7 @@ try {
100100
}
101101
catch (raw_x$3){
102102
var x$3 = Caml_js_exceptions.internalToOCamlException(raw_x$3);
103-
if (x$3.CamlExt === A || x$3.CamlExt === Js_exn.$$Error) {
103+
if (x$3.CamlExt.CamlId === A.CamlId || x$3.CamlExt.CamlId === Js_exn.$$Error.CamlId) {
104104
a0 = x$3._1;
105105
} else {
106106
throw {
@@ -157,7 +157,7 @@ var suites = {
157157
/* tuple */[
158158
"File \"exception_raise_test.ml\", line 116, characters 4-11",
159159
(function (param) {
160-
if (a1.CamlExt === Js_exn.$$Error) {
160+
if (a1.CamlExt.CamlId === Js_exn.$$Error.CamlId) {
161161
return /* Eq */Block.__(0, [
162162
a1._1,
163163
2

jscomp/test/exception_rebound_err_test.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -45,21 +45,21 @@ function test_js_error4(param) {
4545
}
4646
catch (raw_e){
4747
var e = Caml_js_exceptions.internalToOCamlException(raw_e);
48-
if (e.CamlExt === Caml_builtin_exceptions.not_found) {
48+
if (e.CamlExt.CamlId === Caml_builtin_exceptions.not_found.CamlId) {
4949
return 2;
5050
}
51-
if (e.CamlExt === Caml_builtin_exceptions.invalid_argument && e._1 === "x") {
51+
if (e.CamlExt.CamlId === Caml_builtin_exceptions.invalid_argument.CamlId && e._1 === "x") {
5252
return 3;
5353
}
54-
if (e.CamlExt === A) {
54+
if (e.CamlExt.CamlId === A.CamlId) {
5555
if (e._1 !== 2) {
5656
return 7;
5757
} else {
5858
return 4;
5959
}
60-
} else if (e.CamlExt === B) {
60+
} else if (e.CamlExt.CamlId === B.CamlId) {
6161
return 5;
62-
} else if (e.CamlExt === C && !(e._1 !== 1 || e._2 !== 2)) {
62+
} else if (e.CamlExt.CamlId === C.CamlId && !(e._1 !== 1 || e._2 !== 2)) {
6363
return 6;
6464
} else {
6565
return 7;
@@ -73,7 +73,7 @@ function f(g) {
7373
}
7474
catch (raw_exn){
7575
var exn = Caml_js_exceptions.internalToOCamlException(raw_exn);
76-
if (exn.CamlExt === Caml_builtin_exceptions.not_found) {
76+
if (exn.CamlExt.CamlId === Caml_builtin_exceptions.not_found.CamlId) {
7777
return 1;
7878
}
7979
throw exn;

jscomp/test/exception_repr_test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ var Hello = Caml_exceptions.create("Exception_repr_test.Hello");
4040
var A = Caml_exceptions.create("Exception_repr_test.A");
4141

4242
Printexc.register_printer((function (s) {
43-
if (s.CamlExt === Hi) {
43+
if (s.CamlExt.CamlId === Hi.CamlId) {
4444
return "hey";
45-
} else if (s.CamlExt === A) {
45+
} else if (s.CamlExt.CamlId === A.CamlId) {
4646
return Curry._1(Format.asprintf(/* Format */[
4747
/* String_literal */Block.__(11, [
4848
"A(",

jscomp/test/exception_value_test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ function test_not_found(f, param) {
4949
}
5050
catch (raw_exn){
5151
var exn = Caml_js_exceptions.internalToOCamlException(raw_exn);
52-
if (exn.CamlExt === Caml_builtin_exceptions.not_found) {
52+
if (exn.CamlExt.CamlId === Caml_builtin_exceptions.not_found.CamlId) {
5353
return 2;
5454
}
5555
throw exn;
@@ -62,7 +62,7 @@ function test_js_error2(param) {
6262
}
6363
catch (raw_e){
6464
var e = Caml_js_exceptions.internalToOCamlException(raw_e);
65-
if (e.CamlExt === Js_exn.$$Error) {
65+
if (e.CamlExt.CamlId === Js_exn.$$Error.CamlId) {
6666
console.log(e._1.stack);
6767
throw e;
6868
}

jscomp/test/exn_error_pattern.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ var Caml_builtin_exceptions = require("../../lib/js/caml_builtin_exceptions.js")
77

88
function f(match) {
99
if (Caml_exceptions.caml_is_extension(match)) {
10-
if (match.CamlExt === Caml_builtin_exceptions.not_found) {
10+
if (match.CamlExt.CamlId === Caml_builtin_exceptions.not_found.CamlId) {
1111
return 0;
12-
} else if (match.CamlExt === Caml_builtin_exceptions.invalid_argument || match.CamlExt === Caml_builtin_exceptions.stack_overflow) {
12+
} else if (match.CamlExt.CamlId === Caml_builtin_exceptions.invalid_argument.CamlId || match.CamlExt.CamlId === Caml_builtin_exceptions.stack_overflow.CamlId) {
1313
return 1;
14-
} else if (match.CamlExt === Caml_builtin_exceptions.sys_error) {
14+
} else if (match.CamlExt.CamlId === Caml_builtin_exceptions.sys_error.CamlId) {
1515
return 2;
1616
} else {
1717
return ;
@@ -26,11 +26,11 @@ var B = Caml_exceptions.create("Exn_error_pattern.B");
2626

2727
function g(match) {
2828
if (Caml_exceptions.caml_is_extension(match)) {
29-
if (match.CamlExt === Caml_builtin_exceptions.not_found || match.CamlExt === Caml_builtin_exceptions.invalid_argument) {
29+
if (match.CamlExt.CamlId === Caml_builtin_exceptions.not_found.CamlId || match.CamlExt.CamlId === Caml_builtin_exceptions.invalid_argument.CamlId) {
3030
return 0;
31-
} else if (match.CamlExt === Caml_builtin_exceptions.sys_error) {
31+
} else if (match.CamlExt.CamlId === Caml_builtin_exceptions.sys_error.CamlId) {
3232
return 2;
33-
} else if (match.CamlExt === A || match.CamlExt === B) {
33+
} else if (match.CamlExt.CamlId === A.CamlId || match.CamlExt.CamlId === B.CamlId) {
3434
return match._1;
3535
} else {
3636
return ;

jscomp/test/ext_bytes_test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ function starts_with(xs, prefix, p) {
146146
}
147147
catch (raw_exn){
148148
var exn = Caml_js_exceptions.internalToOCamlException(raw_exn);
149-
if (exn.CamlExt === H) {
149+
if (exn.CamlExt.CamlId === H.CamlId) {
150150
return false;
151151
}
152152
throw exn;

jscomp/test/ext_filename_test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ function chop_extension(locOpt, name) {
7171
}
7272
catch (raw_exn){
7373
var exn = Caml_js_exceptions.internalToOCamlException(raw_exn);
74-
if (exn.CamlExt === Caml_builtin_exceptions.invalid_argument) {
74+
if (exn.CamlExt.CamlId === Caml_builtin_exceptions.invalid_argument.CamlId) {
7575
return Curry._2(Format.ksprintf(Pervasives.invalid_arg, /* Format */[
7676
/* String_literal */Block.__(11, [
7777
"Filename.chop_extension ( ",
@@ -102,7 +102,7 @@ function chop_extension_if_any(fname) {
102102
}
103103
catch (raw_exn){
104104
var exn = Caml_js_exceptions.internalToOCamlException(raw_exn);
105-
if (exn.CamlExt === Caml_builtin_exceptions.invalid_argument) {
105+
if (exn.CamlExt.CamlId === Caml_builtin_exceptions.invalid_argument.CamlId) {
106106
return fname;
107107
}
108108
throw exn;

jscomp/test/ext_pervasives_test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ function is_pos_pow(n) {
6262
}
6363
catch (raw_exn){
6464
var exn = Caml_js_exceptions.internalToOCamlException(raw_exn);
65-
if (exn.CamlExt === E) {
65+
if (exn.CamlExt.CamlId === E.CamlId) {
6666
return -1;
6767
}
6868
throw exn;

jscomp/test/ext_string_test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ function find(startOpt, sub, s) {
284284
}
285285
catch (raw_exn){
286286
var exn = Caml_js_exceptions.internalToOCamlException(raw_exn);
287-
if (exn.CamlExt === Local_exit) {
287+
if (exn.CamlExt.CamlId === Local_exit.CamlId) {
288288
return i;
289289
}
290290
throw exn;
@@ -334,7 +334,7 @@ function rfind(sub, s) {
334334
}
335335
catch (raw_exn){
336336
var exn = Caml_js_exceptions.internalToOCamlException(raw_exn);
337-
if (exn.CamlExt === Local_exit) {
337+
if (exn.CamlExt.CamlId === Local_exit.CamlId) {
338338
return i;
339339
}
340340
throw exn;

jscomp/test/extensible_variant_test.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ var N = {
1616
var Int$1 = Caml_exceptions.create("Extensible_variant_test.Int");
1717

1818
function to_int(x) {
19-
if (x.CamlExt === Str) {
19+
if (x.CamlExt.CamlId === Str.CamlId) {
2020
return -1;
2121
}
22-
if (x.CamlExt === Int) {
22+
if (x.CamlExt.CamlId === Int.CamlId) {
2323
return x._1;
2424
}
25-
if (x.CamlExt === Int$1) {
25+
if (x.CamlExt.CamlId === Int$1.CamlId) {
2626
return x._2;
2727
}
2828
throw {

0 commit comments

Comments
 (0)