mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 23:47:45 +00:00
LibJS: Rename PropertyName to PropertyKey
Let's use the same name as the spec. :^)
This commit is contained in:
parent
715e7fada8
commit
398c181c79
55 changed files with 287 additions and 287 deletions
|
@ -219,7 +219,7 @@ ThrowCompletionOr<Vector<String>> canonicalize_locale_list(GlobalObject& global_
|
|||
// 7. Repeat, while k < len,
|
||||
for (size_t k = 0; k < length; ++k) {
|
||||
// a. Let Pk be ToString(k).
|
||||
auto property_key = PropertyName { k };
|
||||
auto property_key = PropertyKey { k };
|
||||
|
||||
// b. Let kPresent be ? HasProperty(O, Pk).
|
||||
auto key_present = TRY(object->has_property(property_key));
|
||||
|
@ -597,7 +597,7 @@ ThrowCompletionOr<Object*> coerce_options_to_object(GlobalObject& global_object,
|
|||
}
|
||||
|
||||
// 9.2.13 GetOption ( options, property, type, values, fallback ), https://tc39.es/ecma402/#sec-getoption
|
||||
ThrowCompletionOr<Value> get_option(GlobalObject& global_object, Object const& options, PropertyName const& property, Value::Type type, Vector<StringView> const& values, Fallback fallback)
|
||||
ThrowCompletionOr<Value> get_option(GlobalObject& global_object, Object const& options, PropertyKey const& property, Value::Type type, Vector<StringView> const& values, Fallback fallback)
|
||||
{
|
||||
auto& vm = global_object.vm();
|
||||
|
||||
|
@ -661,7 +661,7 @@ ThrowCompletionOr<Optional<int>> default_number_option(GlobalObject& global_obje
|
|||
}
|
||||
|
||||
// 9.2.15 GetNumberOption ( options, property, minimum, maximum, fallback ), https://tc39.es/ecma402/#sec-getnumberoption
|
||||
ThrowCompletionOr<Optional<int>> get_number_option(GlobalObject& global_object, Object const& options, PropertyName const& property, int minimum, int maximum, Optional<int> fallback)
|
||||
ThrowCompletionOr<Optional<int>> get_number_option(GlobalObject& global_object, Object const& options, PropertyKey const& property, int minimum, int maximum, Optional<int> fallback)
|
||||
{
|
||||
// 1. Assert: Type(options) is Object.
|
||||
|
||||
|
|
|
@ -46,9 +46,9 @@ Vector<String> lookup_supported_locales(Vector<String> const& requested_locales)
|
|||
Vector<String> best_fit_supported_locales(Vector<String> const& requested_locales);
|
||||
ThrowCompletionOr<Array*> supported_locales(GlobalObject&, Vector<String> const& requested_locales, Value options);
|
||||
ThrowCompletionOr<Object*> coerce_options_to_object(GlobalObject& global_object, Value options);
|
||||
ThrowCompletionOr<Value> get_option(GlobalObject& global_object, Object const& options, PropertyName const& property, Value::Type type, Vector<StringView> const& values, Fallback fallback);
|
||||
ThrowCompletionOr<Value> get_option(GlobalObject& global_object, Object const& options, PropertyKey const& property, Value::Type type, Vector<StringView> const& values, Fallback fallback);
|
||||
ThrowCompletionOr<Optional<int>> default_number_option(GlobalObject& global_object, Value value, int minimum, int maximum, Optional<int> fallback);
|
||||
ThrowCompletionOr<Optional<int>> get_number_option(GlobalObject& global_object, Object const& options, PropertyName const& property, int minimum, int maximum, Optional<int> fallback);
|
||||
ThrowCompletionOr<Optional<int>> get_number_option(GlobalObject& global_object, Object const& options, PropertyKey const& property, int minimum, int maximum, Optional<int> fallback);
|
||||
Vector<PatternPartition> partition_pattern(StringView pattern);
|
||||
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ struct LocaleAndKeys {
|
|||
};
|
||||
|
||||
// Note: This is not an AO in the spec. This just serves to abstract very similar steps in ApplyOptionsToTag and the Intl.Locale constructor.
|
||||
static ThrowCompletionOr<Optional<String>> get_string_option(GlobalObject& global_object, Object const& options, PropertyName const& property, Function<bool(StringView)> validator, Vector<StringView> const& values = {})
|
||||
static ThrowCompletionOr<Optional<String>> get_string_option(GlobalObject& global_object, Object const& options, PropertyKey const& property, Function<bool(StringView)> validator, Vector<StringView> const& values = {})
|
||||
{
|
||||
auto& vm = global_object.vm();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue