package js_of_ocaml-compiler

  1. Overview
  2. Docs
Compiler from OCaml bytecode to JavaScript

Install

dune-project
 Dependency

Authors

Maintainers

Sources

js_of_ocaml-6.5.0.tbz
sha256=a991ce25175a5a13240c8bf64354b8f35e0a8d7223b90bef01ba32bc6f929cf4
sha512=ce476986cb2c78990f29b1d7a01bb173a0d30ad0e0a80ba7bde9aa8365952ed01eda4935d92a323b982b0c1c897b20ef01eabe75fe80e4da858f73f6a2d25232

doc/js_of_ocaml-compiler.runtime/Jsoo_runtime/Error/index.html

Module Jsoo_runtime.ErrorSource

Sourcetype t
Sourceval raise_ : t -> 'a
Sourceval attach_js_backtrace : exn -> force:bool -> exn

Attach a JavaScript error to an OCaml exception. if force = false and a JavaScript error is already attached, it will do nothing. This function is useful to store and retrieve information about JavaScript stack traces.

Attaching JavaScript errors will happen automatically when compiling with --enable with-js-error.

Sourceval of_exn : exn -> t option

Extract a JavaScript error attached to an OCaml exception, if any. This is useful to inspect an eventual stack trace, especially when sourcemap is enabled.

Sourceexception Exn of t

The Error exception wrap javascript exceptions when caught by OCaml code. In case the javascript exception is not an instance of javascript Error, it will be serialized and wrapped into a Failure exception.