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.3.2.tbz
sha256=a93afc9654ec3464701fbce0dccf3a8beb9508acb12c6045776bf2cf106cabc0
sha512=3cd59bd4395a3ac83f546ae20259b026b61cea33e3ef35ab0560ce0baadaf50ebefb704dba28246a3c8b1ce3ff6d8efdc3e514dcbd728af0afb2e2a2c2032620

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.