forked from rescript-lang/rescript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcaml_oo.js
45 lines (40 loc) · 1.09 KB
/
caml_oo.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
// GENERATED CODE BY BUCKLESCRIPT VERSION 0.3 , PLEASE EDIT WITH CARE
'use strict';
var Caml_builtin_exceptions = require("./caml_builtin_exceptions");
var Caml_array = require("./caml_array");
var caml_methods_cache = Caml_array.caml_make_vect(1000, 0);
function caml_get_public_method(obj, tag, cacheid) {
var meths = obj[0];
var offs = caml_methods_cache[cacheid];
if (meths[offs] === tag) {
return meths[offs - 1 | 0];
}
else {
var aux = function (_i) {
while(true) {
var i = _i;
if (i < 3) {
throw [
Caml_builtin_exceptions.assert_failure,
[
"caml_oo.ml",
54,
20
]
];
}
else if (meths[i] === tag) {
caml_methods_cache[cacheid] = i;
return i;
}
else {
_i = i - 2 | 0;
continue ;
}
};
};
return meths[aux((meths[0] << 1) + 1 | 0) - 1 | 0];
}
}
exports.caml_get_public_method = caml_get_public_method;
/* No side effect */