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:
Euclid Ye 2025-08-18 12:39:52 +08:00 committed by GitHub
parent e19fade481
commit ce9425f3e8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 1 additions and 11 deletions

View file

@ -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,