Remove the throw_type_error call from FromJSValConvertible::from_jsval.

This commit is contained in:
Ms2ger 2016-08-24 15:15:40 +02:00
parent 3c4a08c016
commit 6ef5894f01

View file

@ -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)
} }
} }