1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 06:47:35 +00:00

LibJS: Rename PropertyName to PropertyKey

Let's use the same name as the spec. :^)
This commit is contained in:
Andreas Kling 2021-10-24 16:01:24 +02:00
parent 715e7fada8
commit 398c181c79
55 changed files with 287 additions and 287 deletions

View file

@ -11,7 +11,7 @@
#include <AK/Variant.h>
#include <LibJS/Runtime/Completion.h>
#include <LibJS/Runtime/IteratorOperations.h>
#include <LibJS/Runtime/PropertyName.h>
#include <LibJS/Runtime/PropertyKey.h>
#include <LibJS/Runtime/Temporal/AbstractOperations.h>
#include <LibJS/Runtime/Temporal/Calendar.h>
#include <LibJS/Runtime/Temporal/Duration.h>
@ -96,7 +96,7 @@ ThrowCompletionOr<Object*> get_options_object(GlobalObject& global_object, Value
}
// 13.3 GetOption ( options, property, types, values, fallback ), https://tc39.es/proposal-temporal/#sec-getoption
ThrowCompletionOr<Value> get_option(GlobalObject& global_object, Object const& options, PropertyName const& property, Vector<OptionType> const& types, Vector<StringView> const& values, Value fallback)
ThrowCompletionOr<Value> get_option(GlobalObject& global_object, Object const& options, PropertyKey const& property, Vector<OptionType> const& types, Vector<StringView> const& values, Value fallback)
{
VERIFY(property.is_string());
@ -158,7 +158,7 @@ ThrowCompletionOr<Value> get_option(GlobalObject& global_object, Object const& o
// 13.4 GetStringOrNumberOption ( options, property, stringValues, minimum, maximum, fallback ), https://tc39.es/proposal-temporal/#sec-getstringornumberoption
template<typename NumberType>
ThrowCompletionOr<Variant<String, NumberType>> get_string_or_number_option(GlobalObject& global_object, Object const& options, PropertyName const& property, Vector<StringView> const& string_values, NumberType minimum, NumberType maximum, Value fallback)
ThrowCompletionOr<Variant<String, NumberType>> get_string_or_number_option(GlobalObject& global_object, Object const& options, PropertyKey const& property, Vector<StringView> const& string_values, NumberType minimum, NumberType maximum, Value fallback)
{
auto& vm = global_object.vm();

View file

@ -86,9 +86,9 @@ struct SecondsStringPrecision {
ThrowCompletionOr<MarkedValueList> iterable_to_list_of_type(GlobalObject&, Value items, Vector<OptionType> const& element_types);
ThrowCompletionOr<Object*> get_options_object(GlobalObject&, Value options);
ThrowCompletionOr<Value> get_option(GlobalObject&, Object const& options, PropertyName const& property, Vector<OptionType> const& types, Vector<StringView> const& values, Value fallback);
ThrowCompletionOr<Value> get_option(GlobalObject&, Object const& options, PropertyKey const& property, Vector<OptionType> const& types, Vector<StringView> const& values, Value fallback);
template<typename NumberType>
ThrowCompletionOr<Variant<String, NumberType>> get_string_or_number_option(GlobalObject&, Object const& options, PropertyName const& property, Vector<StringView> const& string_values, NumberType minimum, NumberType maximum, Value fallback);
ThrowCompletionOr<Variant<String, NumberType>> get_string_or_number_option(GlobalObject&, Object const& options, PropertyKey const& property, Vector<StringView> const& string_values, NumberType minimum, NumberType maximum, Value fallback);
ThrowCompletionOr<String> to_temporal_overflow(GlobalObject&, Object const& normalized_options);
ThrowCompletionOr<String> to_temporal_rounding_mode(GlobalObject&, Object const& normalized_options, String const& fallback);
ThrowCompletionOr<String> to_show_calendar_option(GlobalObject&, Object const& normalized_options);

View file

@ -939,7 +939,7 @@ ThrowCompletionOr<Object*> default_merge_fields(GlobalObject& global_object, Obj
for (auto& next_key : original_keys) {
// a. If nextKey is not "month" or "monthCode", then
if (next_key.as_string().string() != vm.names.month.as_string() && next_key.as_string().string() != vm.names.monthCode.as_string()) {
auto property_name = PropertyName::from_value(global_object, next_key);
auto property_name = PropertyKey::from_value(global_object, next_key);
// i. Let propValue be ? Get(fields, nextKey).
auto prop_value = TRY(fields.get(property_name));
@ -960,7 +960,7 @@ ThrowCompletionOr<Object*> default_merge_fields(GlobalObject& global_object, Obj
// 5. For each element nextKey of newKeys, do
for (auto& next_key : new_keys) {
auto property_name = PropertyName::from_value(global_object, next_key);
auto property_name = PropertyKey::from_value(global_object, next_key);
// a. Let propValue be ? Get(additionalFields, nextKey).
auto prop_value = TRY(additional_fields.get(property_name));

View file

@ -89,7 +89,7 @@ struct BalancedDuration {
template<typename StructT, typename ValueT>
struct TemporalDurationLikeProperty {
ValueT StructT::*internal_slot { nullptr };
PropertyName property;
PropertyKey property;
};
template<typename StructT, typename ValueT>

View file

@ -76,7 +76,7 @@ struct PartialUnregulatedTemporalTime {
template<typename StructT, typename ValueT>
struct TemporalTimeLikeProperty {
ValueT StructT::*internal_slot { nullptr };
PropertyName property;
PropertyKey property;
};
template<typename StructT, typename ValueT>