aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/bindings/error.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/dom/bindings/error.rs')
-rw-r--r--components/script/dom/bindings/error.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/components/script/dom/bindings/error.rs b/components/script/dom/bindings/error.rs
index f7efb14b694..712fec4f17e 100644
--- a/components/script/dom/bindings/error.rs
+++ b/components/script/dom/bindings/error.rs
@@ -310,19 +310,19 @@ pub(crate) unsafe fn report_pending_exception(
/// Throw an exception to signal that a `JSObject` can not be converted to a
/// given DOM type.
-pub(crate) unsafe fn throw_invalid_this(cx: *mut JSContext, proto_id: u16) {
- debug_assert!(!JS_IsExceptionPending(cx));
+pub(crate) fn throw_invalid_this(cx: SafeJSContext, proto_id: u16) {
+ debug_assert!(unsafe { !JS_IsExceptionPending(*cx) });
let error = format!(
"\"this\" object does not implement interface {}.",
proto_id_to_name(proto_id)
);
- throw_type_error(cx, &error);
+ unsafe { throw_type_error(*cx, &error) };
}
-pub(crate) unsafe fn throw_constructor_without_new(cx: *mut JSContext, name: &str) {
- debug_assert!(!JS_IsExceptionPending(cx));
+pub(crate) fn throw_constructor_without_new(cx: SafeJSContext, name: &str) {
+ debug_assert!(unsafe { !JS_IsExceptionPending(*cx) });
let error = format!("{} constructor: 'new' is required", name);
- throw_type_error(cx, &error);
+ unsafe { throw_type_error(*cx, &error) };
}
impl Error {