A way of explicitly reporting exceptions
bzbarsky at MIT.EDU
Mon Jun 23 12:39:06 PDT 2014
On 6/23/14, 3:08 PM, Tab Atkins Jr. wrote:
> Can't you just pass e into a setTimeout()'d callback, and rethrow it
> from there? Does that mess with the stack or something?
It might for some thrown values in some implementations. It would
definitely mess with reported exception ordering wrt actually uncaught
exceptions... and in cross-realm cases has problems in terms of which
realm's error-reporting machinery should be invoked.
Though I guess any API here has that last problem to some extent,
actually. We might be able to hide it under the hood if the callback
that threw is passed to the API along with the exception.
More information about the es-discuss