mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
script: Implement FromJSValConvertible for Root<T>
This commit is contained in:
parent
4ad1a8ddcc
commit
3327f00bce
1 changed files with 11 additions and 0 deletions
|
@ -94,6 +94,17 @@ impl<T: Float + FromJSValConvertible<Config=()>> FromJSValConvertible for Finite
|
|||
}
|
||||
}
|
||||
|
||||
impl <T: Reflectable + IDLInterface> FromJSValConvertible for Root<T> {
|
||||
type Config = ();
|
||||
|
||||
unsafe fn from_jsval(_cx: *mut JSContext,
|
||||
value: HandleValue,
|
||||
_config: Self::Config)
|
||||
-> Result<Root<T>, ()> {
|
||||
root_from_handlevalue(value)
|
||||
}
|
||||
}
|
||||
|
||||
/// Convert the given `jsid` to a `DOMString`. Fails if the `jsid` is not a
|
||||
/// string, or if the string does not contain valid UTF-16.
|
||||
pub fn jsid_to_str(cx: *mut JSContext, id: HandleId) -> DOMString {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue