diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2022-07-18 12:52:54 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-18 12:52:54 +0200 |
commit | 0f6b455c964933692f4c82476692ab66eba242c2 (patch) | |
tree | 69bc5dda3070a9c46125dfaada87c128b884de27 /core/bindings.rs | |
parent | 22a4998e299ca8658744c745d8f0afeba15730dc (diff) |
Revert "fix(core): unhandled rejection in top-level scope (#15204)" (#15226)
This reverts commit 48a7312f3871e3b76c51eb0143ca1c48da43b20c.
Diffstat (limited to 'core/bindings.rs')
-rw-r--r-- | core/bindings.rs | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/core/bindings.rs b/core/bindings.rs index 49dc62c0e..a88e54af7 100644 --- a/core/bindings.rs +++ b/core/bindings.rs @@ -292,20 +292,12 @@ pub extern "C" fn promise_reject_callback(message: v8::PromiseRejectMessage) { // a) asynchronous, and b) always terminates. if let Some(js_promise_reject_cb) = state.js_promise_reject_cb.clone() { let js_uncaught_exception_cb = state.js_uncaught_exception_cb.clone(); + drop(state); // Drop borrow, callbacks can call back into runtime. let tc_scope = &mut v8::TryCatch::new(scope); let undefined: v8::Local<v8::Value> = v8::undefined(tc_scope).into(); let type_ = v8::Integer::new(tc_scope, message.get_event() as i32); let promise = message.get_promise(); - if let Some(pending_mod_evaluate) = state.pending_mod_evaluate.as_mut() { - if !pending_mod_evaluate.has_evaluated { - let promise_global = v8::Global::new(tc_scope, promise); - pending_mod_evaluate - .handled_promise_rejections - .push(promise_global); - } - } - drop(state); // Drop borrow, callbacks can call back into runtime. let reason = match message.get_event() { PromiseRejectWithNoHandler |