forked from rescript-lang/rescript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ast_mapper_defensive_test.js
99 lines (82 loc) · 1.96 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
97
98
99
'use strict';
var Mt = require("./mt.js");
var Block = require("../../lib/js/block.js");
var Js_mapperRt = require("../../lib/js/js_mapperRt.js");
var suites = [/* [] */0];
var test_id = [0];
function $$throw(loc, x) {
test_id[0] = test_id[0] + 1 | 0;
suites[0] = /* :: */[
/* tuple */[
loc + (" id " + String(test_id[0])),
(function () {
return /* ThrowAny */Block.__(7, [x]);
})
],
suites[0]
];
return /* () */0;
}
function aToJs(param) {
return param + 0 | 0;
}
function aFromJs(param) {
if (!(param <= 2 && 0 <= param)) {
throw new Error("ASSERT FAILURE");
}
return param - 0 | 0;
}
var jsMapperConstantArray = /* array */[
0,
3,
4
];
function bToJs(param) {
return jsMapperConstantArray[param];
}
function bFromJs(param) {
return Js_mapperRt.fromIntAssert(3, jsMapperConstantArray, param);
}
var jsMapperConstantArray$1 = /* array */[
/* tuple */[
22125,
"c0"
],
/* tuple */[
22126,
"c1"
],
/* tuple */[
22127,
"c2"
]
];
function cToJs(param) {
return Js_mapperRt.binarySearch(3, param, jsMapperConstantArray$1);
}
function cFromJs(param) {
return Js_mapperRt.revSearchAssert(3, jsMapperConstantArray$1, param);
}
$$throw("File \"ast_mapper_defensive_test.ml\", line 28, characters 16-23", (function () {
aFromJs(3);
return /* () */0;
}));
$$throw("File \"ast_mapper_defensive_test.ml\", line 29, characters 15-22", (function () {
bFromJs(2);
return /* () */0;
}));
$$throw("File \"ast_mapper_defensive_test.ml\", line 30, characters 15-22", (function () {
cFromJs(33);
return /* () */0;
}));
Mt.from_pair_suites("ast_mapper_defensive_test.ml", suites[0]);
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 */