mirror of
https://github.com/servo/servo.git
synced 2025-09-30 00:29:14 +01:00
embedder: Remove Int
variant from WebDriverJSValue
(#38748)
According to [spec](https://w3c.github.io/webdriver/#dfn-json-deserialize), we should only care about [Number](https://262.ecma-international.org/5.1/#sec-4.3.19) that is f64. This change also closes the gap between `JSValue` and `WebDriverJSValue` and potentially merge into one in the future. Testing: No regression. However, we have lots of TIMEOUT due to https://github.com/servo/servo/pull/38622. Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
This commit is contained in:
parent
e19fade481
commit
ce9425f3e8
4 changed files with 1 additions and 11 deletions
|
@ -369,14 +369,7 @@ unsafe fn jsval_to_webdriver_inner(
|
|||
Ok(WebDriverJSValue::Null)
|
||||
} else if val.get().is_boolean() {
|
||||
Ok(WebDriverJSValue::Boolean(val.get().to_boolean()))
|
||||
} else if val.get().is_int32() {
|
||||
Ok(WebDriverJSValue::Int(
|
||||
match FromJSValConvertible::from_jsval(cx, val, ConversionBehavior::Default).unwrap() {
|
||||
ConversionResult::Success(c) => c,
|
||||
_ => unreachable!(),
|
||||
},
|
||||
))
|
||||
} else if val.get().is_double() {
|
||||
} else if val.get().is_number() {
|
||||
Ok(WebDriverJSValue::Number(
|
||||
match FromJSValConvertible::from_jsval(cx, val, ()).unwrap() {
|
||||
ConversionResult::Success(c) => c,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue