From 118dd47ad0ced501b1ad8d9e1cc2a2f443f101e6 Mon Sep 17 00:00:00 2001 From: Nayeem Rahman Date: Tue, 6 Sep 2022 12:18:23 +0100 Subject: fix(watch): ignore unload errors on drop (#15782) --- core/runtime.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'core') diff --git a/core/runtime.rs b/core/runtime.rs index 5b3b0ce50..42496b271 100644 --- a/core/runtime.rs +++ b/core/runtime.rs @@ -1167,11 +1167,11 @@ pub(crate) fn exception_to_err_result<'s, T>( // If termination is the result of a `op_dispatch_exception` call, we want // to use the exception that was passed to it rather than the exception that // was passed to this function. - let mut state = state_rc.borrow_mut(); + let state = state_rc.borrow(); exception = state .dispatched_exceptions - .pop_back() - .map(|exception| v8::Local::new(scope, exception)) + .back() + .map(|exception| v8::Local::new(scope, exception.clone())) .unwrap_or_else(|| { // Maybe make a new exception object. if was_terminating_execution && exception.is_null_or_undefined() { -- cgit v1.2.3