mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Add support for returning array-like types from the Execute(Async)Script wd command
This commit is contained in:
parent
b3c0ed295f
commit
58f80f4ff3
22 changed files with 88 additions and 187 deletions
|
@ -224,6 +224,12 @@ impl Serialize for SendableWebDriverJSValue {
|
|||
WebDriverJSValue::Boolean(x) => serializer.serialize_bool(x),
|
||||
WebDriverJSValue::Number(x) => serializer.serialize_f64(x),
|
||||
WebDriverJSValue::String(ref x) => serializer.serialize_str(&x),
|
||||
WebDriverJSValue::Element(ref x) => x.serialize(serializer),
|
||||
WebDriverJSValue::ArrayLike(ref x) => x
|
||||
.iter()
|
||||
.map(|element| SendableWebDriverJSValue(element.clone()))
|
||||
.collect::<Vec<SendableWebDriverJSValue>>()
|
||||
.serialize(serializer),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1397,6 +1403,10 @@ impl Handler {
|
|||
ErrorStatus::UnsupportedOperation,
|
||||
"Unsupported return type",
|
||||
)),
|
||||
Err(WebDriverJSError::JSError) => Err(WebDriverError::new(
|
||||
ErrorStatus::JavascriptError,
|
||||
"JS evaluation raised an exception",
|
||||
)),
|
||||
Err(WebDriverJSError::BrowsingContextNotFound) => Err(WebDriverError::new(
|
||||
ErrorStatus::JavascriptError,
|
||||
"Pipeline id not found in browsing context",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue