diff options
author | tanishka <109246904+taniishkaaa@users.noreply.github.com> | 2024-10-22 15:38:55 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-22 10:08:55 +0000 |
commit | 7015e0fb5f1a63ed13a5b07b056036e6e7adbc16 (patch) | |
tree | 0e1cb385daf84a1776ee7a5d2006b90b68e2404f /components/script/dom/bindings/error.rs | |
parent | 575e8855294a9ee2094b110a7c1fea868e69251e (diff) | |
download | servo-7015e0fb5f1a63ed13a5b07b056036e6e7adbc16.tar.gz servo-7015e0fb5f1a63ed13a5b07b056036e6e7adbc16.zip |
CanGc fixes in `errorevent.rs` (#33960)
* CanGc fixes in errorevent.rs
Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com>
* Allow too_many_arguments to avoid lint error
Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com>
---------
Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com>
Diffstat (limited to 'components/script/dom/bindings/error.rs')
-rw-r--r-- | components/script/dom/bindings/error.rs | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/components/script/dom/bindings/error.rs b/components/script/dom/bindings/error.rs index 99b50a0cc0f..d2c0b534f3b 100644 --- a/components/script/dom/bindings/error.rs +++ b/components/script/dom/bindings/error.rs @@ -29,7 +29,7 @@ use crate::dom::bindings::str::USVString; use crate::dom::domexception::{DOMErrorName, DOMException}; use crate::dom::globalscope::GlobalScope; use crate::realms::InRealm; -use crate::script_runtime::JSContext as SafeJSContext; +use crate::script_runtime::{CanGc, JSContext as SafeJSContext}; #[cfg(feature = "js_backtrace")] thread_local! { @@ -267,7 +267,12 @@ impl ErrorInfo { /// /// The `dispatch_event` argument is temporary and non-standard; passing false /// prevents dispatching the `error` event. -pub unsafe fn report_pending_exception(cx: *mut JSContext, dispatch_event: bool, realm: InRealm) { +pub unsafe fn report_pending_exception( + cx: *mut JSContext, + dispatch_event: bool, + realm: InRealm, + can_gc: CanGc, +) { if !JS_IsExceptionPending(cx) { return; } @@ -299,7 +304,7 @@ pub unsafe fn report_pending_exception(cx: *mut JSContext, dispatch_event: bool, } if dispatch_event { - GlobalScope::from_context(cx, realm).report_an_error(error_info, value.handle()); + GlobalScope::from_context(cx, realm).report_an_error(error_info, value.handle(), can_gc); } } |