UNPKG

bs-platform

Version:

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

30 lines (23 loc) 619 B
'use strict'; var Caml_option = require("./caml_option.js"); var Caml_exceptions = require("./caml_exceptions.js"); var $$Error = Caml_exceptions.create("Caml_js_exceptions.Error"); function internalToOCamlException(e) { if (Caml_exceptions.caml_is_extension(e)) { return e; } else { return [ $$Error, e ]; } } function caml_as_js_exn(exn) { if (exn[0] === $$Error) { return Caml_option.some(exn[1]); } } exports.$$Error = $$Error; exports.internalToOCamlException = internalToOCamlException; exports.caml_as_js_exn = caml_as_js_exn; /* No side effect */