mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
script: Add a comment about some conversion that looks fishy.
This commit is contained in:
parent
b29e56eefc
commit
5281fc1a44
1 changed files with 4 additions and 4 deletions
|
@ -84,13 +84,13 @@ impl<T: Float + FromJSValConvertible<Config=()>> FromJSValConvertible for Finite
|
|||
value: HandleValue,
|
||||
option: ())
|
||||
-> Result<ConversionResult<Finite<T>>, ()> {
|
||||
let result = match FromJSValConvertible::from_jsval(cx, value, option) {
|
||||
Ok(ConversionResult::Success(v)) => v,
|
||||
Ok(ConversionResult::Failure(error)) => {
|
||||
let result = match FromJSValConvertible::from_jsval(cx, value, option)? {
|
||||
ConversionResult::Success(v) => v,
|
||||
ConversionResult::Failure(error) => {
|
||||
// FIXME(emilio): Why throwing instead of propagating the error?
|
||||
throw_type_error(cx, &error);
|
||||
return Err(());
|
||||
}
|
||||
_ => return Err(()),
|
||||
};
|
||||
match Finite::new(result) {
|
||||
Some(v) => Ok(ConversionResult::Success(v)),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue