mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 23:37:36 +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
|
@ -138,7 +138,7 @@ bool media_feature_type_is_range(MediaFeatureID media_feature_id)
|
|||
auto member_generator = generator.fork();
|
||||
member_generator.set("name:titlecase", title_casify(name));
|
||||
VERIFY(feature.has("type"sv));
|
||||
auto feature_type = feature.get("type"sv);
|
||||
auto feature_type = feature.get_deprecated("type"sv);
|
||||
VERIFY(feature_type.is_string());
|
||||
member_generator.set("is_range", feature_type.as_string() == "range" ? "true" : "false");
|
||||
member_generator.append(R"~~~(
|
||||
|
@ -173,7 +173,7 @@ bool media_feature_accepts_type(MediaFeatureID media_feature_id, MediaFeatureVal
|
|||
}
|
||||
have_output_value_type_switch = true;
|
||||
};
|
||||
auto& values = feature.get("values"sv);
|
||||
auto& values = feature.get_deprecated("values"sv);
|
||||
VERIFY(values.is_array());
|
||||
auto& values_array = values.as_array();
|
||||
for (auto& type : values_array.values()) {
|
||||
|
@ -251,7 +251,7 @@ bool media_feature_accepts_identifier(MediaFeatureID media_feature_id, ValueID i
|
|||
}
|
||||
have_output_identifier_switch = true;
|
||||
};
|
||||
auto& values = feature.get("values"sv);
|
||||
auto& values = feature.get_deprecated("values"sv);
|
||||
VERIFY(values.is_array());
|
||||
auto& values_array = values.as_array();
|
||||
for (auto& identifier : values_array.values()) {
|
||||
|
|
|
@ -230,7 +230,7 @@ bool is_inherited_property(PropertyID property_id)
|
|||
|
||||
bool inherited = false;
|
||||
if (value.as_object().has("inherited"sv)) {
|
||||
auto& inherited_value = value.as_object().get("inherited"sv);
|
||||
auto& inherited_value = value.as_object().get_deprecated("inherited"sv);
|
||||
VERIFY(inherited_value.is_bool());
|
||||
inherited = inherited_value.as_bool();
|
||||
}
|
||||
|
@ -261,7 +261,7 @@ bool property_affects_layout(PropertyID property_id)
|
|||
|
||||
bool affects_layout = true;
|
||||
if (value.as_object().has("affects-layout"sv))
|
||||
affects_layout = value.as_object().get("affects-layout"sv).to_bool();
|
||||
affects_layout = value.as_object().get_deprecated("affects-layout"sv).to_bool();
|
||||
|
||||
if (affects_layout) {
|
||||
auto member_generator = generator.fork();
|
||||
|
@ -289,7 +289,7 @@ bool property_affects_stacking_context(PropertyID property_id)
|
|||
|
||||
bool affects_stacking_context = false;
|
||||
if (value.as_object().has("affects-stacking-context"sv))
|
||||
affects_stacking_context = value.as_object().get("affects-stacking-context"sv).to_bool();
|
||||
affects_stacking_context = value.as_object().get_deprecated("affects-stacking-context"sv).to_bool();
|
||||
|
||||
if (affects_stacking_context) {
|
||||
auto member_generator = generator.fork();
|
||||
|
@ -326,7 +326,7 @@ NonnullRefPtr<StyleValue> property_initial_value(PropertyID property_id)
|
|||
dbgln("No initial value specified for property '{}'", name);
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
auto& initial_value = object.get("initial"sv);
|
||||
auto& initial_value = object.get_deprecated("initial"sv);
|
||||
VERIFY(initial_value.is_string());
|
||||
auto initial_value_string = initial_value.as_string();
|
||||
|
||||
|
@ -370,7 +370,7 @@ bool property_has_quirk(PropertyID property_id, Quirk quirk)
|
|||
properties.for_each_member([&](auto& name, auto& value) {
|
||||
VERIFY(value.is_object());
|
||||
if (value.as_object().has("quirks"sv)) {
|
||||
auto& quirks_value = value.as_object().get("quirks"sv);
|
||||
auto& quirks_value = value.as_object().get_deprecated("quirks"sv);
|
||||
VERIFY(quirks_value.is_array());
|
||||
auto& quirks = quirks_value.as_array();
|
||||
|
||||
|
@ -461,7 +461,7 @@ bool property_accepts_value(PropertyID property_id, StyleValue& style_value)
|
|||
};
|
||||
|
||||
if (has_valid_types) {
|
||||
auto valid_types_value = object.get("valid-types"sv);
|
||||
auto valid_types_value = object.get_deprecated("valid-types"sv);
|
||||
VERIFY(valid_types_value.is_array());
|
||||
auto valid_types = valid_types_value.as_array();
|
||||
if (!valid_types.is_empty()) {
|
||||
|
@ -536,7 +536,7 @@ bool property_accepts_value(PropertyID property_id, StyleValue& style_value)
|
|||
}
|
||||
|
||||
if (has_valid_identifiers) {
|
||||
auto valid_identifiers_value = object.get("valid-identifiers"sv);
|
||||
auto valid_identifiers_value = object.get_deprecated("valid-identifiers"sv);
|
||||
VERIFY(valid_identifiers_value.is_array());
|
||||
auto valid_identifiers = valid_identifiers_value.as_array();
|
||||
if (!valid_identifiers.is_empty()) {
|
||||
|
@ -581,7 +581,7 @@ size_t property_maximum_value_count(PropertyID property_id)
|
|||
properties.for_each_member([&](auto& name, auto& value) {
|
||||
VERIFY(value.is_object());
|
||||
if (value.as_object().has("max-values"sv)) {
|
||||
auto max_values = value.as_object().get("max-values"sv);
|
||||
auto max_values = value.as_object().get_deprecated("max-values"sv);
|
||||
VERIFY(max_values.is_number() && !max_values.is_double());
|
||||
auto property_generator = generator.fork();
|
||||
property_generator.set("name:titlecase", title_casify(name));
|
||||
|
|
|
@ -166,10 +166,10 @@ TransformFunctionMetadata transform_function_metadata(TransformFunction transfor
|
|||
return TransformFunctionMetadata {
|
||||
.parameters = {)~~~");
|
||||
|
||||
const JsonArray& parameters = value.as_object().get("parameters"sv).as_array();
|
||||
const JsonArray& parameters = value.as_object().get_deprecated("parameters"sv).as_array();
|
||||
bool first = true;
|
||||
parameters.for_each([&](JsonValue const& value) {
|
||||
GenericLexer lexer { value.as_object().get("type"sv).as_string() };
|
||||
GenericLexer lexer { value.as_object().get_deprecated("type"sv).as_string() };
|
||||
VERIFY(lexer.consume_specific('<'));
|
||||
auto parameter_type_name = lexer.consume_until('>');
|
||||
VERIFY(lexer.consume_specific('>'));
|
||||
|
@ -189,7 +189,7 @@ TransformFunctionMetadata transform_function_metadata(TransformFunction transfor
|
|||
member_generator.append(first ? " "sv : ", "sv);
|
||||
first = false;
|
||||
|
||||
member_generator.append(DeprecatedString::formatted("{{ TransformFunctionParameterType::{}, {}}}", parameter_type, value.as_object().get("required"sv).to_deprecated_string()));
|
||||
member_generator.append(DeprecatedString::formatted("{{ TransformFunctionParameterType::{}, {}}}", parameter_type, value.as_object().get_deprecated("required"sv).to_deprecated_string()));
|
||||
});
|
||||
|
||||
member_generator.append(R"~~~( }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue