From:  Jan de Mooij <>
Date:  02 Jun 2016 01:03:00 Hong Kong Time

Error reporting changes


Hi all,

Just a heads-up: we want to change how exceptions are reported to the
embedding [0].

The current/old behavior: the embedding sets an error reporter callback
(JS_SetErrorReporter), and the engine calls this when it throws an
exception and script doesn't catch it.

The new behavior: the callback will be renamed and will only be used for
warnings. Exceptions will be left on the JSContext and the embedding can
use JS_GetPendingException to get it. A RAII class is useful for this, for
instance see our code for the shell [1] and Gecko [2].

You can test this right now by setting the autoJSAPIOwnsErrorReporting
JSContext option. This option (and the dontReportUncaught option) will also
be removed though.

Please let us know if you have any questions or concerns.