mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
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:
parent
1fd609d198
commit
58a8cfda52
2 changed files with 3 additions and 17 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue