diff options
author | Josh Matthews <josh@joshmatthews.net> | 2025-03-29 04:11:27 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-03-29 08:11:27 +0000 |
commit | c30ad5a30e10b9aabe5842624db24b9846c3d5d4 (patch) | |
tree | c879104dc5ef15647d975da14a6b703d4099df4d /components/script/dom/bindings/error.rs | |
parent | 2c9411095255f804a43c2abc05c5aaa2a0becca7 (diff) | |
download | servo-c30ad5a30e10b9aabe5842624db24b9846c3d5d4.tar.gz servo-c30ad5a30e10b9aabe5842624db24b9846c3d5d4.zip |
Miscellaneous script splitting preparation changes (#36216)
* script: Move num module to script_bindings.
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* script: Make JS reflector creation generic over DOM trait.
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* script: Move bindings-specific lock to script_bindings.
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* script: Move DOM proto array code to script_bindings.
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* script: Move finalizer implementations to script_bindings.
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* script: Move some error routines to script_bindings.
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* script: Move some DOM interface conversion routines to script_bindings.
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* script: Make is_array_like generic over DOM trait.
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* script: Use generic interfaces for conditional exposure functions.
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* script: Move a bunch of routines used by codegen to script_bindings.
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* Formatting.
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* Fix clippy warnings.
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
---------
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
Diffstat (limited to 'components/script/dom/bindings/error.rs')
-rw-r--r-- | components/script/dom/bindings/error.rs | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/components/script/dom/bindings/error.rs b/components/script/dom/bindings/error.rs index 13bdd97cad1..b9d51e77fcf 100644 --- a/components/script/dom/bindings/error.rs +++ b/components/script/dom/bindings/error.rs @@ -20,7 +20,6 @@ pub(crate) use script_bindings::error::*; #[cfg(feature = "js_backtrace")] use crate::dom::bindings::cell::DomRefCell; -use crate::dom::bindings::codegen::PrototypeList::proto_id_to_name; use crate::dom::bindings::conversions::{ ConversionResult, FromJSValConvertible, ToJSValConvertible, root_from_object, }; @@ -257,23 +256,6 @@ pub(crate) fn report_pending_exception( } } -/// Throw an exception to signal that a `JSObject` can not be converted to a -/// given DOM type. -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) - ); - unsafe { throw_type_error(*cx, &error) }; -} - -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); - unsafe { throw_type_error(*cx, &error) }; -} - pub(crate) trait ErrorToJsval { fn to_jsval( self, |