aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/testbinding.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/dom/testbinding.rs')
-rw-r--r--components/script/dom/testbinding.rs20
1 files changed, 17 insertions, 3 deletions
diff --git a/components/script/dom/testbinding.rs b/components/script/dom/testbinding.rs
index 2dd77427590..a5bb29a7e76 100644
--- a/components/script/dom/testbinding.rs
+++ b/components/script/dom/testbinding.rs
@@ -38,6 +38,7 @@ use js::jsapi::{HandleObject, HandleValue, Heap, JSContext, JSObject};
use js::jsapi::{JS_NewPlainObject, JS_NewUint8ClampedArray};
use js::jsval::{JSVal, NullValue};
use js::rust::CustomAutoRooterGuard;
+use js::typedarray;
use script_traits::MsDuration;
use servo_config::prefs::PREFS;
use std::borrow::ToOwned;
@@ -293,6 +294,14 @@ impl TestBindingMethods for TestBinding {
fn ReceiveInterfaceSequence(&self) -> Vec<DomRoot<Blob>> {
vec![Blob::new(&self.global(), BlobImpl::new_from_bytes(vec![]), "".to_owned())]
}
+ #[allow(unsafe_code)]
+ unsafe fn ReceiveUnionIdentity(
+ &self,
+ _: *mut JSContext,
+ arg: UnionTypes::StringOrObject,
+ ) -> UnionTypes::StringOrObject {
+ arg
+ }
fn ReceiveNullableBoolean(&self) -> Option<bool> { Some(false) }
fn ReceiveNullableByte(&self) -> Option<i8> { Some(0) }
@@ -339,12 +348,12 @@ impl TestBindingMethods for TestBinding {
fn ReceiveNullableSequence(&self) -> Option<Vec<i32>> { Some(vec![1]) }
fn ReceiveTestDictionaryWithSuccessOnKeyword(&self) -> RootedTraceableBox<TestDictionary> {
RootedTraceableBox::new(TestDictionary {
- anyValue: Heap::default(),
+ anyValue: RootedTraceableBox::new(Heap::default()),
booleanValue: None,
byteValue: None,
dict: RootedTraceableBox::new(TestDictionaryDefaults {
UnrestrictedDoubleValue: 0.0,
- anyValue: Heap::default(),
+ anyValue: RootedTraceableBox::new(Heap::default()),
booleanValue: false,
bytestringValue: ByteString::new(vec![]),
byteValue: 0,
@@ -360,7 +369,7 @@ impl TestBindingMethods for TestBinding {
nullableFloatValue: None,
nullableLongLongValue: None,
nullableLongValue: None,
- nullableObjectValue: Heap::default(),
+ nullableObjectValue: RootedTraceableBox::new(Heap::default()),
nullableOctetValue: None,
nullableShortValue: None,
nullableStringValue: None,
@@ -428,6 +437,9 @@ impl TestBindingMethods for TestBinding {
fn PassByteString(&self, _: ByteString) {}
fn PassEnum(&self, _: TestEnum) {}
fn PassInterface(&self, _: &Blob) {}
+ fn PassTypedArray(&self, _: CustomAutoRooterGuard<typedarray::Int8Array>) {}
+ fn PassTypedArray2(&self, _: CustomAutoRooterGuard<typedarray::ArrayBuffer>) {}
+ fn PassTypedArray3(&self, _: CustomAutoRooterGuard<typedarray::ArrayBufferView>) {}
fn PassUnion(&self, _: HTMLElementOrLong) {}
fn PassUnion2(&self, _: EventOrString) {}
fn PassUnion3(&self, _: BlobOrString) {}
@@ -439,6 +451,7 @@ impl TestBindingMethods for TestBinding {
fn PassUnion9(&self, _: UnionTypes::TestDictionaryOrLong) {}
#[allow(unsafe_code)]
unsafe fn PassUnion10(&self, _: *mut JSContext, _: UnionTypes::StringOrObject) {}
+ fn PassUnion11(&self, _: UnionTypes::ArrayBufferOrArrayBufferView) {}
fn PassUnionWithTypedef(&self, _: DocumentOrTestTypedef) {}
fn PassUnionWithTypedef2(&self, _: LongSequenceOrTestTypedef) {}
#[allow(unsafe_code)]
@@ -479,6 +492,7 @@ impl TestBindingMethods for TestBinding {
fn PassNullableInterface(&self, _: Option<&Blob>) {}
#[allow(unsafe_code)]
unsafe fn PassNullableObject(&self, _: *mut JSContext, _: *mut JSObject) {}
+ fn PassNullableTypedArray(&self, _: CustomAutoRooterGuard<Option<typedarray::Int8Array>>) { }
fn PassNullableUnion(&self, _: Option<HTMLElementOrLong>) {}
fn PassNullableUnion2(&self, _: Option<EventOrString>) {}
fn PassNullableUnion3(&self, _: Option<StringOrLongSequence>) {}