mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 19:07:35 +00:00
AK: Add new failable JsonArray::{append/set}
functions
Move all old usages to the more explicit `JsonArray:must_{append/set}`
This commit is contained in:
parent
3b00636288
commit
8134dccdc7
14 changed files with 28 additions and 25 deletions
|
@ -1521,7 +1521,7 @@ Messages::WebDriverClient::GetAllCookiesResponse WebDriverConnection::get_all_co
|
|||
auto serialized_cookie = serialize_cookie(cookie);
|
||||
|
||||
// 2. Append serialized cookie to cookies
|
||||
cookies.append(move(serialized_cookie));
|
||||
cookies.must_append(move(serialized_cookie));
|
||||
}
|
||||
|
||||
// 5. Return success with data cookies.
|
||||
|
@ -1997,7 +1997,7 @@ ErrorOr<JsonArray, Web::WebDriver::Error> WebDriverConnection::find(StartNodeGet
|
|||
|
||||
// 8. For each element in elements returned, append the web element reference object for element, to result.
|
||||
for (size_t i = 0; i < elements->length(); ++i)
|
||||
result.append(web_element_reference_object(*elements->item(i)));
|
||||
result.must_append(web_element_reference_object(*elements->item(i)));
|
||||
|
||||
// 9. Return success with data result.
|
||||
return result;
|
||||
|
|
|
@ -162,7 +162,7 @@ Web::WebDriver::Response Session::get_window_handles() const
|
|||
|
||||
// 2. For each top-level browsing context in the remote end, push the associated window handle onto handles.
|
||||
for (auto const& window_handle : m_windows.keys()) {
|
||||
handles.append(JsonValue(window_handle));
|
||||
handles.must_append(JsonValue(window_handle));
|
||||
}
|
||||
|
||||
// 3. Return success with data handles.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue