UNPKG

bs-platform

Version:

bucklescript compiler, ocaml standard libary by bucklescript and its required runtime support

47 lines (34 loc) 820 B
import * as Caml_obj from "./caml_obj.js"; import * as Caml_array from "./caml_array.js"; import * as Caml_option from "./caml_option.js"; function caml_weak_create(n) { return new Array(n); } function caml_weak_set(xs, i, v) { if (v !== undefined) { xs[i] = Caml_option.valFromOption(v); return ; } } function caml_weak_get(xs, i) { return Caml_option.undefined_to_opt(xs[i]); } function caml_weak_get_copy(xs, i) { var x = xs[i]; if (x !== undefined) { return Caml_option.some(Caml_obj.caml_obj_dup(x)); } } function caml_weak_check(xs, i) { return xs[i] !== undefined; } var caml_weak_blit = Caml_array.caml_array_blit; export { caml_weak_create , caml_weak_set , caml_weak_get , caml_weak_get_copy , caml_weak_check , caml_weak_blit , } /* No side effect */