mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01: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,
|
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)),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue