forked from rescript-lang/rescript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathast_mapper_defensive_test.js
96 lines (79 loc) · 1.87 KB
/
ast_mapper_defensive_test.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
'use strict';
var Mt = require("./mt.js");
var Js_mapperRt = require("../../lib/js/js_mapperRt.js");
var suites = {
contents: /* [] */0
};
var test_id = {
contents: 0
};
function $$throw(loc, x) {
test_id.contents = test_id.contents + 1 | 0;
suites.contents = {
hd: [
loc + (" id " + String(test_id.contents)),
(function (param) {
return {
TAG: /* ThrowAny */7,
_0: x
};
})
],
tl: suites.contents
};
}
function aToJs(param) {
return param + 0 | 0;
}
function aFromJs(param) {
if (!(param <= 2 && 0 <= param)) {
throw {
RE_EXN_ID: "Assert_failure",
_1: [
"_none_",
1,
-1
],
Error: new Error()
};
}
return param - 0 | 0;
}
var jsMapperConstantArray = [
0,
3,
4
];
function bToJs(param) {
return jsMapperConstantArray[param];
}
function bFromJs(param) {
return Js_mapperRt.fromIntAssert(3, jsMapperConstantArray, param);
}
var _map = {"c0":"c0","c1":"c1","c2":"c2"};
function cToJs(param) {
return param;
}
function cFromJs(param) {
return Js_mapperRt.raiseWhenNotFound(_map[param]);
}
$$throw("File \"ast_mapper_defensive_test.ml\", line 28, characters 16-23", (function (param) {
aFromJs(3);
}));
$$throw("File \"ast_mapper_defensive_test.ml\", line 29, characters 15-22", (function (param) {
bFromJs(2);
}));
$$throw("File \"ast_mapper_defensive_test.ml\", line 30, characters 15-22", (function (param) {
cFromJs(33);
}));
Mt.from_pair_suites("Ast_mapper_defensive_test", suites.contents);
exports.suites = suites;
exports.test_id = test_id;
exports.$$throw = $$throw;
exports.aToJs = aToJs;
exports.aFromJs = aFromJs;
exports.bToJs = bToJs;
exports.bFromJs = bFromJs;
exports.cToJs = cToJs;
exports.cFromJs = cFromJs;
/* Not a pure module */