script: Add a comment about some conversion that looks fishy.

This commit is contained in:
Emilio Cobos Álvarez 2017-09-17 07:43:05 +02:00
parent b29e56eefc
commit 5281fc1a44
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C

View file

@ -84,13 +84,13 @@ impl<T: Float + FromJSValConvertible<Config=()>> FromJSValConvertible for Finite
value: HandleValue, value: HandleValue,
option: ()) option: ())
-> Result<ConversionResult<Finite<T>>, ()> { -> Result<ConversionResult<Finite<T>>, ()> {
let result = match FromJSValConvertible::from_jsval(cx, value, option) { let result = match FromJSValConvertible::from_jsval(cx, value, option)? {
Ok(ConversionResult::Success(v)) => v, ConversionResult::Success(v) => v,
Ok(ConversionResult::Failure(error)) => { ConversionResult::Failure(error) => {
// FIXME(emilio): Why throwing instead of propagating the error?
throw_type_error(cx, &error); throw_type_error(cx, &error);
return Err(()); return Err(());
} }
_ => return Err(()),
}; };
match Finite::new(result) { match Finite::new(result) {
Some(v) => Ok(ConversionResult::Success(v)), Some(v) => Ok(ConversionResult::Success(v)),