forked from rescript-lang/rescript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathast_js_mapper_test.js
61 lines (52 loc) · 975 Bytes
/
ast_js_mapper_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
'use strict';
function tToJs(param) {
return {
xx: param[/* xx */0],
yy: param[/* yy */1],
zz: param[/* zz */2]
};
}
function tFromJs(param) {
return /* record */[
/* xx */param.xx,
/* yy */param.yy,
/* zz */param.zz
];
}
var u = tToJs(/* record */[
/* xx */3,
/* yy */"x",
/* zz : tuple */[
1,
2
]
]);
tFromJs(u);
tFromJs({
xx: 3,
yy: "2",
zz: /* tuple */[
1,
2
],
cc: 3
});
function searchForSureExists(xs, k) {
var _i = 0;
var xs$1 = xs;
var k$1 = k;
while(true) {
var i = _i;
var match = xs$1[i];
if (match[0] === k$1) {
return match[1];
} else {
_i = i + 1 | 0;
continue ;
}
};
}
exports.tToJs = tToJs;
exports.tFromJs = tFromJs;
exports.searchForSureExists = searchForSureExists;
/* u Not a pure module */