123456789101112131415161718192021222324(* The gen_js_api is released under the terms of an MIT-like license. *)(* See the attached LICENSE file. *)(* Copyright 2015 by LexiFi. *)typet=Ojs.tletnamex=Ojs.string_of_js(Ojs.get_prop_asciix"name")letmessagex=Ojs.string_of_js(Ojs.get_prop_asciix"message")letstackx=Ojs.option_of_jsOjs.string_of_js(Ojs.get_prop_asciix"stack")letto_stringx=Ojs.string_of_js(Ojs.callx"toString"[||])exceptionErroroftlet()=Callback.register_exception"jsError"(Error(Ojs.obj[||]))(* The js_of_ocaml runtime expects to have this registered.
So it's probably a bad idea to use both this Ojs_exn module
and the js_of_ocaml standard library. *)let()=Printexc.register_printer(function|Errorx->Some(to_stringx)|_->None)