Do not import union constructors in dom::testbinding

This commit is contained in:
Anthony Ramine 2015-10-22 10:00:20 +02:00
parent 6d72293681
commit e66a361e08

View file

@ -6,16 +6,9 @@
use dom::bindings::codegen::Bindings::EventListenerBinding::EventListener; use dom::bindings::codegen::Bindings::EventListenerBinding::EventListener;
use dom::bindings::codegen::Bindings::FunctionBinding::Function; use dom::bindings::codegen::Bindings::FunctionBinding::Function;
use dom::bindings::codegen::Bindings::TestBindingBinding::TestBindingMethods; use dom::bindings::codegen::Bindings::TestBindingBinding::{TestBindingMethods, TestEnum};
use dom::bindings::codegen::Bindings::TestBindingBinding::TestEnum; use dom::bindings::codegen::UnionTypes::{BlobOrString, EventOrString};
use dom::bindings::codegen::Bindings::TestBindingBinding::TestEnum::_empty; use dom::bindings::codegen::UnionTypes::{EventOrUSVString, HTMLElementOrLong};
use dom::bindings::codegen::UnionTypes::BlobOrString;
use dom::bindings::codegen::UnionTypes::EventOrString;
use dom::bindings::codegen::UnionTypes::EventOrString::eString;
use dom::bindings::codegen::UnionTypes::EventOrUSVString;
use dom::bindings::codegen::UnionTypes::EventOrUSVString::eUSVString;
use dom::bindings::codegen::UnionTypes::HTMLElementOrLong;
use dom::bindings::codegen::UnionTypes::HTMLElementOrLong::eLong;
use dom::bindings::global::{GlobalRef, global_root_from_reflector}; use dom::bindings::global::{GlobalRef, global_root_from_reflector};
use dom::bindings::js::Root; use dom::bindings::js::Root;
use dom::bindings::num::Finite; use dom::bindings::num::Finite;
@ -67,17 +60,19 @@ impl TestBindingMethods for TestBinding {
fn SetUsvstringAttribute(&self, _: USVString) {} fn SetUsvstringAttribute(&self, _: USVString) {}
fn ByteStringAttribute(&self) -> ByteString { ByteString::new(vec!()) } fn ByteStringAttribute(&self) -> ByteString { ByteString::new(vec!()) }
fn SetByteStringAttribute(&self, _: ByteString) {} fn SetByteStringAttribute(&self, _: ByteString) {}
fn EnumAttribute(&self) -> TestEnum { _empty } fn EnumAttribute(&self) -> TestEnum { TestEnum::_empty }
fn SetEnumAttribute(&self, _: TestEnum) {} fn SetEnumAttribute(&self, _: TestEnum) {}
fn InterfaceAttribute(&self) -> Root<Blob> { fn InterfaceAttribute(&self) -> Root<Blob> {
Blob::new(global_root_from_reflector(self).r(), None, "") Blob::new(global_root_from_reflector(self).r(), None, "")
} }
fn SetInterfaceAttribute(&self, _: &Blob) {} fn SetInterfaceAttribute(&self, _: &Blob) {}
fn UnionAttribute(&self) -> HTMLElementOrLong { eLong(0) } fn UnionAttribute(&self) -> HTMLElementOrLong { HTMLElementOrLong::eLong(0) }
fn SetUnionAttribute(&self, _: HTMLElementOrLong) {} fn SetUnionAttribute(&self, _: HTMLElementOrLong) {}
fn Union2Attribute(&self) -> EventOrString { eString(DOMString::new()) } fn Union2Attribute(&self) -> EventOrString { EventOrString::eString(DOMString::new()) }
fn SetUnion2Attribute(&self, _: EventOrString) {} fn SetUnion2Attribute(&self, _: EventOrString) {}
fn Union3Attribute(&self) -> EventOrUSVString { eUSVString(USVString("".to_owned())) } fn Union3Attribute(&self) -> EventOrUSVString {
EventOrUSVString::eUSVString(USVString("".to_owned()))
}
fn SetUnion3Attribute(&self, _: EventOrUSVString) {} fn SetUnion3Attribute(&self, _: EventOrUSVString) {}
fn ArrayAttribute(&self, _: *mut JSContext) -> *mut JSObject { NullValue().to_object_or_null() } fn ArrayAttribute(&self, _: *mut JSContext) -> *mut JSObject { NullValue().to_object_or_null() }
fn AnyAttribute(&self, _: *mut JSContext) -> JSVal { NullValue() } fn AnyAttribute(&self, _: *mut JSContext) -> JSVal { NullValue() }
@ -124,16 +119,20 @@ impl TestBindingMethods for TestBinding {
fn BinaryRenamedAttribute2(&self) -> DOMString { DOMString::new() } fn BinaryRenamedAttribute2(&self) -> DOMString { DOMString::new() }
fn Attr_to_automatically_rename(&self) -> DOMString { DOMString::new() } fn Attr_to_automatically_rename(&self) -> DOMString { DOMString::new() }
fn SetAttr_to_automatically_rename(&self, _: DOMString) {} fn SetAttr_to_automatically_rename(&self, _: DOMString) {}
fn GetEnumAttributeNullable(&self) -> Option<TestEnum> { Some(_empty) } fn GetEnumAttributeNullable(&self) -> Option<TestEnum> { Some(TestEnum::_empty) }
fn GetInterfaceAttributeNullable(&self) -> Option<Root<Blob>> { fn GetInterfaceAttributeNullable(&self) -> Option<Root<Blob>> {
Some(Blob::new(global_root_from_reflector(self).r(), None, "")) Some(Blob::new(global_root_from_reflector(self).r(), None, ""))
} }
fn SetInterfaceAttributeNullable(&self, _: Option<&Blob>) {} fn SetInterfaceAttributeNullable(&self, _: Option<&Blob>) {}
fn GetObjectAttributeNullable(&self, _: *mut JSContext) -> *mut JSObject { ptr::null_mut() } fn GetObjectAttributeNullable(&self, _: *mut JSContext) -> *mut JSObject { ptr::null_mut() }
fn SetObjectAttributeNullable(&self, _: *mut JSContext, _: *mut JSObject) {} fn SetObjectAttributeNullable(&self, _: *mut JSContext, _: *mut JSObject) {}
fn GetUnionAttributeNullable(&self) -> Option<HTMLElementOrLong> { Some(eLong(0)) } fn GetUnionAttributeNullable(&self) -> Option<HTMLElementOrLong> {
Some(HTMLElementOrLong::eLong(0))
}
fn SetUnionAttributeNullable(&self, _: Option<HTMLElementOrLong>) {} fn SetUnionAttributeNullable(&self, _: Option<HTMLElementOrLong>) {}
fn GetUnion2AttributeNullable(&self) -> Option<EventOrString> { Some(eString(DOMString::new())) } fn GetUnion2AttributeNullable(&self) -> Option<EventOrString> {
Some(EventOrString::eString(DOMString::new()))
}
fn SetUnion2AttributeNullable(&self, _: Option<EventOrString>) {} fn SetUnion2AttributeNullable(&self, _: Option<EventOrString>) {}
fn BinaryRenamedMethod(&self) -> () {} fn BinaryRenamedMethod(&self) -> () {}
fn ReceiveVoid(&self) -> () {} fn ReceiveVoid(&self) -> () {}
@ -153,14 +152,14 @@ impl TestBindingMethods for TestBinding {
fn ReceiveString(&self) -> DOMString { DOMString::new() } fn ReceiveString(&self) -> DOMString { DOMString::new() }
fn ReceiveUsvstring(&self) -> USVString { USVString("".to_owned()) } fn ReceiveUsvstring(&self) -> USVString { USVString("".to_owned()) }
fn ReceiveByteString(&self) -> ByteString { ByteString::new(vec!()) } fn ReceiveByteString(&self) -> ByteString { ByteString::new(vec!()) }
fn ReceiveEnum(&self) -> TestEnum { _empty } fn ReceiveEnum(&self) -> TestEnum { TestEnum::_empty }
fn ReceiveInterface(&self) -> Root<Blob> { fn ReceiveInterface(&self) -> Root<Blob> {
Blob::new(global_root_from_reflector(self).r(), None, "") Blob::new(global_root_from_reflector(self).r(), None, "")
} }
fn ReceiveAny(&self, _: *mut JSContext) -> JSVal { NullValue() } fn ReceiveAny(&self, _: *mut JSContext) -> JSVal { NullValue() }
fn ReceiveObject(&self, _: *mut JSContext) -> *mut JSObject { panic!() } fn ReceiveObject(&self, _: *mut JSContext) -> *mut JSObject { panic!() }
fn ReceiveUnion(&self) -> HTMLElementOrLong { eLong(0) } fn ReceiveUnion(&self) -> HTMLElementOrLong { HTMLElementOrLong::eLong(0) }
fn ReceiveUnion2(&self) -> EventOrString { eString(DOMString::new()) } fn ReceiveUnion2(&self) -> EventOrString { EventOrString::eString(DOMString::new()) }
fn ReceiveNullableBoolean(&self) -> Option<bool> { Some(false) } fn ReceiveNullableBoolean(&self) -> Option<bool> { Some(false) }
fn ReceiveNullableByte(&self) -> Option<i8> { Some(0) } fn ReceiveNullableByte(&self) -> Option<i8> { Some(0) }
@ -178,13 +177,17 @@ impl TestBindingMethods for TestBinding {
fn ReceiveNullableString(&self) -> Option<DOMString> { Some(DOMString::new()) } fn ReceiveNullableString(&self) -> Option<DOMString> { Some(DOMString::new()) }
fn ReceiveNullableUsvstring(&self) -> Option<USVString> { Some(USVString("".to_owned())) } fn ReceiveNullableUsvstring(&self) -> Option<USVString> { Some(USVString("".to_owned())) }
fn ReceiveNullableByteString(&self) -> Option<ByteString> { Some(ByteString::new(vec!())) } fn ReceiveNullableByteString(&self) -> Option<ByteString> { Some(ByteString::new(vec!())) }
fn ReceiveNullableEnum(&self) -> Option<TestEnum> { Some(_empty) } fn ReceiveNullableEnum(&self) -> Option<TestEnum> { Some(TestEnum::_empty) }
fn ReceiveNullableInterface(&self) -> Option<Root<Blob>> { fn ReceiveNullableInterface(&self) -> Option<Root<Blob>> {
Some(Blob::new(global_root_from_reflector(self).r(), None, "")) Some(Blob::new(global_root_from_reflector(self).r(), None, ""))
} }
fn ReceiveNullableObject(&self, _: *mut JSContext) -> *mut JSObject { ptr::null_mut() } fn ReceiveNullableObject(&self, _: *mut JSContext) -> *mut JSObject { ptr::null_mut() }
fn ReceiveNullableUnion(&self) -> Option<HTMLElementOrLong> { Some(eLong(0)) } fn ReceiveNullableUnion(&self) -> Option<HTMLElementOrLong> {
fn ReceiveNullableUnion2(&self) -> Option<EventOrString> { Some(eString(DOMString::new())) } Some(HTMLElementOrLong::eLong(0))
}
fn ReceiveNullableUnion2(&self) -> Option<EventOrString> {
Some(EventOrString::eString(DOMString::new()))
}
fn PassBoolean(&self, _: bool) {} fn PassBoolean(&self, _: bool) {}
fn PassByte(&self, _: i8) {} fn PassByte(&self, _: i8) {}