mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Remove the throw_type_error call from FromJSValConvertible::from_jsval.
This commit is contained in:
parent
3c4a08c016
commit
6ef5894f01
1 changed files with 5 additions and 6 deletions
|
@ -104,15 +104,14 @@ impl<T: Float + FromJSValConvertible<Config=()>> FromJSValConvertible for Finite
|
||||||
impl <T: Reflectable + IDLInterface> FromJSValConvertible for Root<T> {
|
impl <T: Reflectable + IDLInterface> FromJSValConvertible for Root<T> {
|
||||||
type Config = ();
|
type Config = ();
|
||||||
|
|
||||||
unsafe fn from_jsval(cx: *mut JSContext,
|
unsafe fn from_jsval(_cx: *mut JSContext,
|
||||||
value: HandleValue,
|
value: HandleValue,
|
||||||
_config: Self::Config)
|
_config: Self::Config)
|
||||||
-> Result<ConversionResult<Root<T>>, ()> {
|
-> Result<ConversionResult<Root<T>>, ()> {
|
||||||
let result = root_from_handlevalue(value);
|
Ok(match root_from_handlevalue(value) {
|
||||||
if let Err(()) = result {
|
Ok(result) => ConversionResult::Success(result),
|
||||||
throw_type_error(cx, "value is not an object");
|
Err(()) => ConversionResult::Failure("value is not an object".into()),
|
||||||
}
|
})
|
||||||
result.map(ConversionResult::Success)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue