aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/testbinding.rs
diff options
context:
space:
mode:
authorJosh Matthews <josh@joshmatthews.net>2023-05-28 22:43:55 -0400
committerJosh Matthews <josh@joshmatthews.net>2023-05-28 23:23:12 -0400
commitdbff26bce05d404027ef5bbfd85fb5995e4726bc (patch)
tree6ebb631eef396c2f387fe8269b0d59bde0dccae2 /components/script/dom/testbinding.rs
parentd9600ff50f3c1bdd8c44e2dfc15a18416d80cb82 (diff)
downloadservo-dbff26bce05d404027ef5bbfd85fb5995e4726bc.tar.gz
servo-dbff26bce05d404027ef5bbfd85fb5995e4726bc.zip
Support arbitrary protos when wrapping DOM objects with constructors.
Diffstat (limited to 'components/script/dom/testbinding.rs')
-rw-r--r--components/script/dom/testbinding.rs18
1 files changed, 9 insertions, 9 deletions
diff --git a/components/script/dom/testbinding.rs b/components/script/dom/testbinding.rs
index b8d2fefc951..9788b3fa85f 100644
--- a/components/script/dom/testbinding.rs
+++ b/components/script/dom/testbinding.rs
@@ -40,7 +40,7 @@ use crate::dom::bindings::error::{Error, Fallible};
use crate::dom::bindings::num::Finite;
use crate::dom::bindings::record::Record;
use crate::dom::bindings::refcounted::TrustedPromise;
-use crate::dom::bindings::reflector::{reflect_dom_object, DomObject, Reflector};
+use crate::dom::bindings::reflector::{reflect_dom_object2, DomObject, Reflector};
use crate::dom::bindings::root::DomRoot;
use crate::dom::bindings::str::{ByteString, DOMString, USVString};
use crate::dom::bindings::trace::RootedTraceableBox;
@@ -84,22 +84,22 @@ impl TestBinding {
}
}
- pub fn new(global: &GlobalScope) -> DomRoot<TestBinding> {
- reflect_dom_object(Box::new(TestBinding::new_inherited()), global)
+ fn new(global: &GlobalScope, proto: Option<HandleObject>) -> DomRoot<TestBinding> {
+ reflect_dom_object2(Box::new(TestBinding::new_inherited()), global, proto)
}
- pub fn Constructor(global: &GlobalScope) -> Fallible<DomRoot<TestBinding>> {
- Ok(TestBinding::new(global))
+ pub fn Constructor(global: &GlobalScope, proto: Option<HandleObject>) -> Fallible<DomRoot<TestBinding>> {
+ Ok(TestBinding::new(global, proto))
}
#[allow(unused_variables)]
- pub fn Constructor_(global: &GlobalScope, nums: Vec<f64>) -> Fallible<DomRoot<TestBinding>> {
- Ok(TestBinding::new(global))
+ pub fn Constructor_(global: &GlobalScope, proto: Option<HandleObject>, nums: Vec<f64>) -> Fallible<DomRoot<TestBinding>> {
+ Ok(TestBinding::new(global, proto))
}
#[allow(unused_variables)]
- pub fn Constructor__(global: &GlobalScope, num: f64) -> Fallible<DomRoot<TestBinding>> {
- Ok(TestBinding::new(global))
+ pub fn Constructor__(global: &GlobalScope, proto: Option<HandleObject>, num: f64) -> Fallible<DomRoot<TestBinding>> {
+ Ok(TestBinding::new(global, proto))
}
}