Merge pull request #1179 from alexcrichton/catch-all-errors

In debug mode log all imported uncaught exceptions
This commit is contained in:
Alex Crichton
2019-01-14 17:28:15 -08:00
committed by GitHub
2 changed files with 27 additions and 1 deletions

View File

@ -2420,6 +2420,9 @@ impl<'a, 'b> SubContext<'a, 'b> {
// Build up our shim's state, and we'll use that to guide whether we
// actually emit an import here or not.
let mut shim = Rust2Js::new(self.cx);
if shim.cx.config.debug {
shim.catch_and_rethrow(true);
}
shim.catch(import.catch)
.variadic(import.variadic)
.process(descriptor.unwrap_function())?;