mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 09:27:35 +00:00
AK+Everywhere: Rename JsonObject::get() to ::get_deprecated()
This is a preparatory step to making `get()` return `ErrorOr`.
This commit is contained in:
parent
efe4329f9f
commit
1dd6b7f5b7
76 changed files with 671 additions and 671 deletions
|
@ -267,20 +267,20 @@ static JsonValue match_capabilities(JsonObject const& capabilities)
|
|||
// -> "browserName"
|
||||
if (name == "browserName"sv) {
|
||||
// If value is not a string equal to the "browserName" entry in matched capabilities, return success with data null.
|
||||
if (value.as_string() != matched_capabilities.get(name).as_string())
|
||||
if (value.as_string() != matched_capabilities.get_deprecated(name).as_string())
|
||||
return AK::Error::from_string_view("browserName"sv);
|
||||
}
|
||||
// -> "browserVersion"
|
||||
else if (name == "browserVersion"sv) {
|
||||
// Compare value to the "browserVersion" entry in matched capabilities using an implementation-defined comparison algorithm. The comparison is to accept a value that places constraints on the version using the "<", "<=", ">", and ">=" operators.
|
||||
// If the two values do not match, return success with data null.
|
||||
if (!matches_browser_version(value.as_string(), matched_capabilities.get(name).as_string()))
|
||||
if (!matches_browser_version(value.as_string(), matched_capabilities.get_deprecated(name).as_string()))
|
||||
return AK::Error::from_string_view("browserVersion"sv);
|
||||
}
|
||||
// -> "platformName"
|
||||
else if (name == "platformName"sv) {
|
||||
// If value is not a string equal to the "platformName" entry in matched capabilities, return success with data null.
|
||||
if (!matches_platform_name(value.as_string(), matched_capabilities.get(name).as_string()))
|
||||
if (!matches_platform_name(value.as_string(), matched_capabilities.get_deprecated(name).as_string()))
|
||||
return AK::Error::from_string_view("platformName"sv);
|
||||
}
|
||||
// -> "acceptInsecureCerts"
|
||||
|
|
|
@ -48,7 +48,7 @@ ErrorOr<TimeoutsConfiguration, Error> json_deserialize_as_a_timeouts_configurati
|
|||
// 3. If value has a property with the key "script":
|
||||
if (value.as_object().has("script"sv)) {
|
||||
// 1. Let script duration be the value of property "script".
|
||||
auto const& script_duration = value.as_object().get("script"sv);
|
||||
auto const& script_duration = value.as_object().get_deprecated("script"sv);
|
||||
|
||||
// 2. If script duration is a number and less than 0 or greater than maximum safe integer, or it is not null, return error with error code invalid argument.
|
||||
if (script_duration.is_number() && (script_duration.to_i64() < 0 || script_duration.to_i64() > max_safe_integer))
|
||||
|
@ -63,7 +63,7 @@ ErrorOr<TimeoutsConfiguration, Error> json_deserialize_as_a_timeouts_configurati
|
|||
// 4. If value has a property with the key "pageLoad":
|
||||
if (value.as_object().has("pageLoad"sv)) {
|
||||
// 1. Let page load duration be the value of property "pageLoad".
|
||||
auto const& page_load_duration = value.as_object().get("pageLoad"sv);
|
||||
auto const& page_load_duration = value.as_object().get_deprecated("pageLoad"sv);
|
||||
|
||||
// 2. If page load duration is less than 0 or greater than maximum safe integer, return error with error code invalid argument.
|
||||
if (!page_load_duration.is_number() || page_load_duration.to_i64() < 0 || page_load_duration.to_i64() > max_safe_integer)
|
||||
|
@ -76,7 +76,7 @@ ErrorOr<TimeoutsConfiguration, Error> json_deserialize_as_a_timeouts_configurati
|
|||
// 5. If value has a property with the key "implicit":
|
||||
if (value.as_object().has("implicit"sv)) {
|
||||
// 1. Let implicit duration be the value of property "implicit".
|
||||
auto const& implicit_duration = value.as_object().get("implicit"sv);
|
||||
auto const& implicit_duration = value.as_object().get_deprecated("implicit"sv);
|
||||
|
||||
// 2. If implicit duration is less than 0 or greater than maximum safe integer, return error with error code invalid argument.
|
||||
if (!implicit_duration.is_number() || implicit_duration.to_i64() < 0 || implicit_duration.to_i64() > max_safe_integer)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue