diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2022-07-23 00:40:42 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-23 00:40:42 +0200 |
commit | 504d2936ecf1a5520ca20f83792a94b219e84f53 (patch) | |
tree | f4d23c520355f340374529d67b31657821e73163 /core/bindings.rs | |
parent | 72199303d899b8ddf2ff46ed11bd513ed9cc47e2 (diff) |
fix: unhandledrejection handling for sync throw in top level (#15279)
Fixes an edge in "unhandledrejection" event that prevent synchronous
errors being surfaced when throw from a top-level scope.
Diffstat (limited to 'core/bindings.rs')
-rw-r--r-- | core/bindings.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/core/bindings.rs b/core/bindings.rs index 6fa9f745b..a93a3e746 100644 --- a/core/bindings.rs +++ b/core/bindings.rs @@ -363,6 +363,8 @@ pub extern "C" fn promise_reject_callback(message: v8::PromiseRejectMessage) { } } + // TODO(bartlomieju): remove this whole block, `js_uncaught_exception_cb` is + // not needed anymore if let Some(exception) = tc_scope.exception() { if let Some(js_uncaught_exception_cb) = js_uncaught_exception_cb { tc_scope.reset(); // Cancel pending exception. |