forked from rescript-lang/rescript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcaml_exceptions.js
50 lines (41 loc) · 872 Bytes
/
caml_exceptions.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
'use strict';
function make(name, id) {
return {
ExceptionID: id,
Debug: name
};
}
var id = {
contents: 0
};
function caml_set_oo_id(b) {
b[1] = id.contents;
id.contents = id.contents + 1;
return b;
}
function create(str) {
id.contents = id.contents + 1;
return {
ExceptionID: id.contents,
Debug: str
};
}
var caml_is_extension = (function (e){
if(e == null ) {
return false
}
return typeof e.ExceptionID === "number"
});
function caml_exn_slot_id(x) {
return x.ExceptionID;
}
function caml_exn_slot_name(x) {
return x.Debug;
}
exports.make = make;
exports.caml_set_oo_id = caml_set_oo_id;
exports.create = create;
exports.caml_is_extension = caml_is_extension;
exports.caml_exn_slot_id = caml_exn_slot_id;
exports.caml_exn_slot_name = caml_exn_slot_name;
/* No side effect */