mirror of
https://github.com/servo/servo.git
synced 2025-10-13 06:50:28 +01:00
Use ToJSValConvertible to convert enums to JSVal.
This commit is contained in:
parent
9a909229e3
commit
ccaa46e4a3
3 changed files with 17 additions and 9 deletions
|
@ -4,6 +4,8 @@
|
|||
|
||||
use dom::bindings::js::JS;
|
||||
use dom::bindings::utils::{Reflector, Reflectable};
|
||||
use dom::bindings::codegen::TestBindingBinding::TestEnum;
|
||||
use dom::bindings::codegen::TestBindingBinding::TestEnumValues::_empty;
|
||||
use dom::blob::Blob;
|
||||
use dom::window::Window;
|
||||
use servo_util::str::DOMString;
|
||||
|
@ -42,6 +44,7 @@ impl TestBinding {
|
|||
pub fn SetDoubleAttribute(&self, _: f64) {}
|
||||
pub fn StringAttribute(&self) -> DOMString { ~"" }
|
||||
pub fn SetStringAttribute(&self, _: DOMString) {}
|
||||
pub fn EnumAttribute(&self) -> TestEnum { _empty }
|
||||
pub fn InterfaceAttribute(&self) -> JS<Blob> { Blob::new(&self.window) }
|
||||
pub fn SetInterfaceAttribute(&self, _: &JS<Blob>) {}
|
||||
pub fn AnyAttribute(&self, _: *JSContext) -> JSVal { NullValue() }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue