Drop the FromJSValConvertible implementation for interfaces.

It doesn't really fit in the design, and native_from_reflector_jsmanaged has
gained the usability improvements that it used to lack.
This commit is contained in:
Ms2ger 2015-04-07 13:11:45 +02:00
parent 1fd609d198
commit 58a8cfda52
2 changed files with 3 additions and 17 deletions

View file

@ -569,17 +569,6 @@ pub fn native_from_reflector_jsmanaged<T>(mut obj: *mut JSObject) -> Result<Unro
}
}
impl<T: Reflectable+IDLInterface> FromJSValConvertible for Unrooted<T> {
type Config = ();
fn from_jsval(_cx: *mut JSContext, value: JSVal, _option: ())
-> Result<Unrooted<T>, ()> {
if !value.is_object() {
return Err(());
}
native_from_reflector_jsmanaged(value.to_object())
}
}
impl<T: Reflectable> ToJSValConvertible for Root<T> {
fn to_jsval(&self, cx: *mut JSContext) -> JSVal {
self.r().reflector().to_jsval(cx)