mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
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>
This commit is contained in:
parent
575e885529
commit
7015e0fb5f
21 changed files with 79 additions and 51 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue