aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/gpuuncapturederrorevent.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/dom/gpuuncapturederrorevent.rs')
-rw-r--r--components/script/dom/gpuuncapturederrorevent.rs18
1 files changed, 15 insertions, 3 deletions
diff --git a/components/script/dom/gpuuncapturederrorevent.rs b/components/script/dom/gpuuncapturederrorevent.rs
index 30c9692a27d..bdf62162dfe 100644
--- a/components/script/dom/gpuuncapturederrorevent.rs
+++ b/components/script/dom/gpuuncapturederrorevent.rs
@@ -7,12 +7,13 @@ use crate::dom::bindings::codegen::Bindings::GPUUncapturedErrorEventBinding::{
GPUUncapturedErrorEventInit, GPUUncapturedErrorEventMethods,
};
use crate::dom::bindings::codegen::Bindings::GPUValidationErrorBinding::GPUError;
-use crate::dom::bindings::reflector::reflect_dom_object;
+use crate::dom::bindings::reflector::reflect_dom_object2;
use crate::dom::bindings::root::DomRoot;
use crate::dom::bindings::str::DOMString;
use crate::dom::event::Event;
use crate::dom::globalscope::GlobalScope;
use dom_struct::dom_struct;
+use js::rust::HandleObject;
use servo_atoms::Atom;
#[dom_struct]
@@ -35,9 +36,19 @@ impl GPUUncapturedErrorEvent {
type_: DOMString,
init: &GPUUncapturedErrorEventInit,
) -> DomRoot<Self> {
- let ev = reflect_dom_object(
+ Self::new_with_proto(global, None, type_, init)
+ }
+
+ fn new_with_proto(
+ global: &GlobalScope,
+ proto: Option<HandleObject>,
+ type_: DOMString,
+ init: &GPUUncapturedErrorEventInit,
+ ) -> DomRoot<Self> {
+ let ev = reflect_dom_object2(
Box::new(GPUUncapturedErrorEvent::new_inherited(init)),
global,
+ proto,
);
ev.event.init_event(
Atom::from(type_),
@@ -51,10 +62,11 @@ impl GPUUncapturedErrorEvent {
#[allow(non_snake_case)]
pub fn Constructor(
global: &GlobalScope,
+ proto: Option<HandleObject>,
type_: DOMString,
init: &GPUUncapturedErrorEventInit,
) -> DomRoot<Self> {
- GPUUncapturedErrorEvent::new(global, type_, init)
+ GPUUncapturedErrorEvent::new_with_proto(global, proto, type_, init)
}
}