diff options
Diffstat (limited to 'components/script/dom/bindings/error.rs')
-rw-r--r-- | components/script/dom/bindings/error.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/components/script/dom/bindings/error.rs b/components/script/dom/bindings/error.rs index b88a6cabed3..f678611423b 100644 --- a/components/script/dom/bindings/error.rs +++ b/components/script/dom/bindings/error.rs @@ -19,6 +19,7 @@ use crate::script_runtime::JSContext as SafeJSContext; #[cfg(feature = "js_backtrace")] use backtrace::Backtrace; use js::error::{throw_range_error, throw_type_error}; +use js::jsapi::ExceptionStackBehavior; use js::jsapi::JSContext; use js::jsapi::JS_ClearPendingException; use js::jsapi::JS_IsExceptionPending; @@ -161,7 +162,7 @@ pub fn throw_dom_exception(cx: SafeJSContext, global: &GlobalScope, result: Erro let exception = DOMException::new(global, code); rooted!(in(*cx) let mut thrown = UndefinedValue()); exception.to_jsval(*cx, thrown.handle_mut()); - JS_SetPendingException(*cx, thrown.handle()); + JS_SetPendingException(*cx, thrown.handle(), ExceptionStackBehavior::Capture); } } |