diff --git a/components/script/dom/rtcerror.rs b/components/script/dom/rtcerror.rs index 351827eebbc..3c3254ebc40 100644 --- a/components/script/dom/rtcerror.rs +++ b/components/script/dom/rtcerror.rs @@ -9,16 +9,16 @@ use crate::dom::bindings::codegen::Bindings::RTCErrorBinding::{ RTCErrorDetailType, RTCErrorInit, RTCErrorMethods, }; use crate::dom::bindings::reflector::{reflect_dom_object_with_proto, DomGlobal}; -use crate::dom::bindings::root::{Dom, DomRoot}; +use crate::dom::bindings::root::DomRoot; use crate::dom::bindings::str::DOMString; -use crate::dom::domexception::{DOMErrorName, DOMException}; +use crate::dom::domexception::DOMException; use crate::dom::globalscope::GlobalScope; use crate::dom::window::Window; use crate::script_runtime::CanGc; #[dom_struct] pub(crate) struct RTCError { - exception: Dom, + exception: DOMException, error_detail: RTCErrorDetailType, sdp_line_number: Option, http_request_status_code: Option, @@ -28,18 +28,9 @@ pub(crate) struct RTCError { } impl RTCError { - fn new_inherited( - global: &GlobalScope, - init: &RTCErrorInit, - message: DOMString, - can_gc: CanGc, - ) -> RTCError { + fn new_inherited(init: &RTCErrorInit, message: DOMString) -> RTCError { RTCError { - exception: Dom::from_ref(&*DOMException::new( - global, - DOMErrorName::from(&message).unwrap(), - can_gc, - )), + exception: DOMException::new_inherited(message, "OperationError".into()), error_detail: init.errorDetail, sdp_line_number: init.sdpLineNumber, http_request_status_code: init.httpRequestStatusCode, @@ -66,7 +57,7 @@ impl RTCError { can_gc: CanGc, ) -> DomRoot { reflect_dom_object_with_proto( - Box::new(RTCError::new_inherited(global, init, message, can_gc)), + Box::new(RTCError::new_inherited(init, message)), global, proto, can_gc,