diff --git a/Userland/Libraries/LibJS/Runtime/Intl/AbstractOperations.cpp b/Userland/Libraries/LibJS/Runtime/Intl/AbstractOperations.cpp index 6844758727..730ee19d0c 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/AbstractOperations.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/AbstractOperations.cpp @@ -201,7 +201,7 @@ ThrowCompletionOr> canonicalize_locale_list(GlobalObject& global_ Object* object = nullptr; // 3. If Type(locales) is String or Type(locales) is Object and locales has an [[InitializedLocale]] internal slot, then if (locales.is_string() || (locales.is_object() && is(locales.as_object()))) { - // a. Let O be CreateArrayFromList(« locales »). + // a. Let O be ! CreateArrayFromList(« locales »). object = Array::create_from(global_object, { locales }); } // 4. Else, @@ -245,12 +245,12 @@ ThrowCompletionOr> canonicalize_locale_list(GlobalObject& global_ tag = TRY(key_value.to_string(global_object)); } - // v. If IsStructurallyValidLanguageTag(tag) is false, throw a RangeError exception. + // v. If ! IsStructurallyValidLanguageTag(tag) is false, throw a RangeError exception. auto locale_id = is_structurally_valid_language_tag(tag); if (!locale_id.has_value()) return vm.throw_completion(global_object, ErrorType::IntlInvalidLanguageTag, tag); - // vi. Let canonicalizedTag be CanonicalizeUnicodeLocaleId(tag). + // vi. Let canonicalizedTag be ! CanonicalizeUnicodeLocaleId(tag). auto canonicalized_tag = JS::Intl::canonicalize_unicode_locale_id(*locale_id); // vii. If canonicalizedTag is not an element of seen, append canonicalizedTag as the last element of seen. @@ -310,7 +310,7 @@ static MatcherResult lookup_matcher(Vector const& requested_locales) auto extensions = locale_id->remove_extension_type(); auto no_extensions_locale = locale_id->to_string(); - // b. Let availableLocale be BestAvailableLocale(availableLocales, noExtensionsLocale). + // b. Let availableLocale be ! BestAvailableLocale(availableLocales, noExtensionsLocale). auto available_locale = best_available_locale(no_extensions_locale); // c. If availableLocale is not undefined, then @@ -330,7 +330,7 @@ static MatcherResult lookup_matcher(Vector const& requested_locales) } } - // 3. Let defLocale be DefaultLocale(). + // 3. Let defLocale be ! DefaultLocale(). // 4. Set result.[[locale]] to defLocale. result.locale = Unicode::default_locale(); @@ -386,12 +386,12 @@ LocaleResult resolve_locale(Vector const& requested_locales, LocaleOptio // 2. If matcher is "lookup", then if (matcher.is_string() && (matcher.as_string().string() == "lookup"sv)) { - // a. Let r be LookupMatcher(availableLocales, requestedLocales). + // a. Let r be ! LookupMatcher(availableLocales, requestedLocales). matcher_result = lookup_matcher(requested_locales); } // 3. Else, else { - // a. Let r be BestFitMatcher(availableLocales, requestedLocales). + // a. Let r be ! BestFitMatcher(availableLocales, requestedLocales). matcher_result = best_fit_matcher(requested_locales); } @@ -540,7 +540,7 @@ Vector lookup_supported_locales(Vector const& requested_locales) locale_id->remove_extension_type(); auto no_extensions_locale = locale_id->to_string(); - // b. Let availableLocale be BestAvailableLocale(availableLocales, noExtensionsLocale). + // b. Let availableLocale be ! BestAvailableLocale(availableLocales, noExtensionsLocale). auto available_locale = best_available_locale(no_extensions_locale); // c. If availableLocale is not undefined, append locale to the end of subset. @@ -588,7 +588,7 @@ ThrowCompletionOr supported_locales(GlobalObject& global_object, Vector< supported_locales = lookup_supported_locales(requested_locales); } - // 5. Return CreateArrayFromList(supportedLocales). + // 5. Return ! CreateArrayFromList(supportedLocales). return Array::create_from(global_object, supported_locales, [&vm](auto& locale) { return js_string(vm, locale); }); } diff --git a/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormat.cpp b/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormat.cpp index 0a545af792..93e13dbddb 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormat.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormat.cpp @@ -72,7 +72,7 @@ ThrowCompletionOr to_date_time_options(GlobalObject& global_object, Val if (!options_value.is_undefined()) options = TRY(options_value.to_object(global_object)); - // 2. Let options be OrdinaryObjectCreate(options). + // 2. Let options be ! OrdinaryObjectCreate(options). options = Object::create(global_object, options); // 3. Let needDefaults be true. @@ -524,7 +524,7 @@ ThrowCompletionOr> format_date_time_pattern(GlobalObjec return static_cast(number_format); }; - // 4. Let nfOptions be OrdinaryObjectCreate(null). + // 4. Let nfOptions be ! OrdinaryObjectCreate(null). auto* number_format_options = Object::create(global_object, nullptr); // 5. Perform ! CreateDataPropertyOrThrow(nfOptions, "useGrouping", false). @@ -533,7 +533,7 @@ ThrowCompletionOr> format_date_time_pattern(GlobalObjec // 6. Let nf be ? Construct(%NumberFormat%, « locale, nfOptions »). auto* number_format = TRY(construct_number_format(number_format_options)); - // 7. Let nf2Options be OrdinaryObjectCreate(null). + // 7. Let nf2Options be ! OrdinaryObjectCreate(null). auto* number_format_options2 = Object::create(global_object, nullptr); // 8. Perform ! CreateDataPropertyOrThrow(nf2Options, "minimumIntegerDigits", 2). @@ -553,7 +553,7 @@ ThrowCompletionOr> format_date_time_pattern(GlobalObjec if (date_time_format.has_fractional_second_digits()) { fractional_second_digits = date_time_format.fractional_second_digits(); - // a. Let nf3Options be OrdinaryObjectCreate(null). + // a. Let nf3Options be ! OrdinaryObjectCreate(null). auto* number_format_options3 = Object::create(global_object, nullptr); // b. Perform ! CreateDataPropertyOrThrow(nf3Options, "minimumIntegerDigits", fractionalSecondDigits). @@ -827,7 +827,7 @@ ThrowCompletionOr format_date_time_to_parts(GlobalObject& global_object, // 1. Let parts be ? PartitionDateTimePattern(dateTimeFormat, x). auto parts = TRY(partition_date_time_pattern(global_object, date_time_format, time)); - // 2. Let result be ArrayCreate(0). + // 2. Let result be ! ArrayCreate(0). auto* result = MUST(Array::create(global_object, 0)); // 3. Let n be 0. @@ -835,7 +835,7 @@ ThrowCompletionOr format_date_time_to_parts(GlobalObject& global_object, // 4. For each Record { [[Type]], [[Value]] } part in parts, do for (auto& part : parts) { - // a. Let O be OrdinaryObjectCreate(%Object.prototype%). + // a. Let O be ! OrdinaryObjectCreate(%Object.prototype%). auto* object = Object::create(global_object, global_object.object_prototype()); // b. Perform ! CreateDataPropertyOrThrow(O, "type", part.[[Type]]). @@ -1147,7 +1147,7 @@ ThrowCompletionOr format_date_time_range_to_parts(GlobalObject& global_o // 1. Let parts be ? PartitionDateTimeRangePattern(dateTimeFormat, x, y). auto parts = TRY(partition_date_time_range_pattern(global_object, date_time_format, start, end)); - // 2. Let result be ArrayCreate(0). + // 2. Let result be ! ArrayCreate(0). auto* result = MUST(Array::create(global_object, 0)); // 3. Let n be 0. @@ -1155,7 +1155,7 @@ ThrowCompletionOr format_date_time_range_to_parts(GlobalObject& global_o // 4. For each Record { [[Type]], [[Value]], [[Source]] } part in parts, do for (auto& part : parts) { - // a. Let O be OrdinaryObjectCreate(%ObjectPrototype%). + // a. Let O be ! OrdinaryObjectCreate(%ObjectPrototype%). auto* object = Object::create(global_object, global_object.object_prototype()); // b. Perform ! CreateDataPropertyOrThrow(O, "type", part.[[Type]]). diff --git a/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormatFunction.cpp b/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormatFunction.cpp index e91a1c810b..82d4a8721b 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormatFunction.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormatFunction.cpp @@ -46,7 +46,7 @@ ThrowCompletionOr DateTimeFormatFunction::call() // 3. If date is not provided or is undefined, then if (date.is_undefined()) { - // a. Let x be Call(%Date.now%, undefined). + // a. Let x be ! Call(%Date.now%, undefined). date = MUST(JS::call(global_object, global_object.date_constructor_now_function(), js_undefined())); } // 4. Else, diff --git a/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormatPrototype.cpp b/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormatPrototype.cpp index a12e55e5bc..b1a92f0eda 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormatPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormatPrototype.cpp @@ -71,7 +71,7 @@ JS_DEFINE_NATIVE_FUNCTION(DateTimeFormatPrototype::format_to_parts) // 3. If date is undefined, then if (date.is_undefined()) { - // a. Let x be Call(%Date.now%, undefined). + // a. Let x be ! Call(%Date.now%, undefined). date = MUST(call(global_object, global_object.date_constructor_now_function(), js_undefined())); } // 4. Else, diff --git a/Userland/Libraries/LibJS/Runtime/Intl/Intl.cpp b/Userland/Libraries/LibJS/Runtime/Intl/Intl.cpp index 022d1f2785..edd3c7abef 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/Intl.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/Intl.cpp @@ -69,7 +69,7 @@ JS_DEFINE_NATIVE_FUNCTION(Intl::get_canonical_locales) for (auto& locale : locale_list) marked_locale_list.append(js_string(vm, move(locale))); - // 2. Return CreateArrayFromList(ll). + // 2. Return ! CreateArrayFromList(ll). return Array::create_from(global_object, marked_locale_list); } diff --git a/Userland/Libraries/LibJS/Runtime/Intl/ListFormat.cpp b/Userland/Libraries/LibJS/Runtime/Intl/ListFormat.cpp index 552bf0dcfc..21b8bee773 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/ListFormat.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/ListFormat.cpp @@ -48,7 +48,7 @@ StringView ListFormat::type_string() const // 13.5.1 DeconstructPattern ( pattern, placeables ), https://tc39.es/ecma402/#sec-deconstructpattern Vector deconstruct_pattern(StringView pattern, Placeables placeables) { - // 1. Let patternParts be PartitionPattern(pattern). + // 1. Let patternParts be ! PartitionPattern(pattern). auto pattern_parts = partition_pattern(pattern); // 2. Let result be a new empty List. @@ -125,7 +125,7 @@ Vector create_parts_from_list(ListFormat const& list_format, V placeables.set("0"sv, move(first)); placeables.set("1"sv, move(second)); - // f. Return DeconstructPattern(pattern, placeables). + // f. Return ! DeconstructPattern(pattern, placeables). return deconstruct_pattern(pattern, move(placeables)); } @@ -171,7 +171,7 @@ Vector create_parts_from_list(ListFormat const& list_format, V placeables.set("0"sv, move(head)); placeables.set("1"sv, move(parts)); - // g. Set parts to DeconstructPattern(pattern, placeables). + // g. Set parts to ! DeconstructPattern(pattern, placeables). parts = deconstruct_pattern(pattern, move(placeables)); // h. Decrement i by 1. @@ -184,7 +184,7 @@ Vector create_parts_from_list(ListFormat const& list_format, V // 13.5.3 FormatList ( listFormat, list ), https://tc39.es/ecma402/#sec-formatlist String format_list(ListFormat const& list_format, Vector const& list) { - // 1. Let parts be CreatePartsFromList(listFormat, list). + // 1. Let parts be ! CreatePartsFromList(listFormat, list). auto parts = create_parts_from_list(list_format, list); // 2. Let result be an empty String. @@ -205,10 +205,10 @@ Array* format_list_to_parts(GlobalObject& global_object, ListFormat const& list_ { auto& vm = global_object.vm(); - // 1. Let parts be CreatePartsFromList(listFormat, list). + // 1. Let parts be ! CreatePartsFromList(listFormat, list). auto parts = create_parts_from_list(list_format, list); - // 2. Let result be ArrayCreate(0). + // 2. Let result be ! ArrayCreate(0). auto* result = MUST(Array::create(global_object, 0)); // 3. Let n be 0. @@ -216,7 +216,7 @@ Array* format_list_to_parts(GlobalObject& global_object, ListFormat const& list_ // 4. For each Record { [[Type]], [[Value]] } part in parts, do for (auto& part : parts) { - // a. Let O be OrdinaryObjectCreate(%Object.prototype%). + // a. Let O be ! OrdinaryObjectCreate(%Object.prototype%). auto* object = Object::create(global_object, global_object.object_prototype()); // b. Perform ! CreateDataPropertyOrThrow(O, "type", part.[[Type]]). diff --git a/Userland/Libraries/LibJS/Runtime/Intl/ListFormatPrototype.cpp b/Userland/Libraries/LibJS/Runtime/Intl/ListFormatPrototype.cpp index 3fec5f95dc..a3101d5b2d 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/ListFormatPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/ListFormatPrototype.cpp @@ -45,7 +45,7 @@ JS_DEFINE_NATIVE_FUNCTION(ListFormatPrototype::format) // 3. Let stringList be ? StringListFromIterable(list). auto string_list = TRY(string_list_from_iterable(global_object, list)); - // 4. Return FormatList(lf, stringList). + // 4. Return ! FormatList(lf, stringList). auto formatted = format_list(*list_format, string_list); return js_string(vm, move(formatted)); } @@ -62,7 +62,7 @@ JS_DEFINE_NATIVE_FUNCTION(ListFormatPrototype::format_to_parts) // 3. Let stringList be ? StringListFromIterable(list). auto string_list = TRY(string_list_from_iterable(global_object, list)); - // 4. Return FormatListToParts(lf, stringList). + // 4. Return ! FormatListToParts(lf, stringList). return format_list_to_parts(global_object, *list_format, string_list); } diff --git a/Userland/Libraries/LibJS/Runtime/Intl/LocaleConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Intl/LocaleConstructor.cpp index 30d315e4f3..63f95312f3 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/LocaleConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/LocaleConstructor.cpp @@ -48,7 +48,7 @@ static ThrowCompletionOr apply_options_to_tag(GlobalObject& global_objec // 1. Assert: Type(tag) is String. // 2. Assert: Type(options) is Object. - // 3. If IsStructurallyValidLanguageTag(tag) is false, throw a RangeError exception. + // 3. If ! IsStructurallyValidLanguageTag(tag) is false, throw a RangeError exception. auto locale_id = is_structurally_valid_language_tag(tag); if (!locale_id.has_value()) return vm.throw_completion(global_object, ErrorType::IntlInvalidLanguageTag, tag); @@ -68,7 +68,7 @@ static ThrowCompletionOr apply_options_to_tag(GlobalObject& global_objec // a. If region does not match the unicode_region_subtag production, throw a RangeError exception. auto region = TRY(get_string_option(global_object, options, vm.names.region, Unicode::is_unicode_region_subtag)); - // 10. Set tag to CanonicalizeUnicodeLocaleId(tag). + // 10. Set tag to ! CanonicalizeUnicodeLocaleId(tag). auto canonicalized_tag = JS::Intl::canonicalize_unicode_locale_id(*locale_id); // 11. Assert: tag matches the unicode_locale_id production. @@ -103,7 +103,7 @@ static ThrowCompletionOr apply_options_to_tag(GlobalObject& global_objec } // 16. Set tag to tag with the substring corresponding to the unicode_language_id production replaced by the string languageId. - // 17. Return CanonicalizeUnicodeLocaleId(tag). + // 17. Return ! CanonicalizeUnicodeLocaleId(tag). return JS::Intl::canonicalize_unicode_locale_id(*locale_id); } diff --git a/Userland/Libraries/LibJS/Runtime/Intl/NumberFormat.cpp b/Userland/Libraries/LibJS/Runtime/Intl/NumberFormat.cpp index 894c578fde..86f05a0ed6 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/NumberFormat.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/NumberFormat.cpp @@ -809,7 +809,7 @@ Array* format_numeric_to_parts(GlobalObject& global_object, NumberFormat& number // Note: Our implementation of PartitionNumberPattern does not throw. auto parts = partition_number_pattern(global_object, number_format, number); - // 2. Let result be ArrayCreate(0). + // 2. Let result be ! ArrayCreate(0). auto* result = MUST(Array::create(global_object, 0)); // 3. Let n be 0. @@ -817,7 +817,7 @@ Array* format_numeric_to_parts(GlobalObject& global_object, NumberFormat& number // 4. For each Record { [[Type]], [[Value]] } part in parts, do for (auto& part : parts) { - // a. Let O be OrdinaryObjectCreate(%Object.prototype%). + // a. Let O be ! OrdinaryObjectCreate(%Object.prototype%). auto* object = Object::create(global_object, global_object.object_prototype()); // b. Perform ! CreateDataPropertyOrThrow(O, "type", part.[[Type]]). diff --git a/Userland/Libraries/LibJS/Runtime/Intl/PluralRulesPrototype.cpp b/Userland/Libraries/LibJS/Runtime/Intl/PluralRulesPrototype.cpp index 3aef812e17..0e73d7e568 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/PluralRulesPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/PluralRulesPrototype.cpp @@ -61,7 +61,7 @@ JS_DEFINE_NATIVE_FUNCTION(PluralRulesPrototype::resolved_options) // FIXME: Implement this when the data is available in LibUnicode. MarkedVector plural_categories { vm.heap() }; - // 6. Perform ! CreateDataProperty(options, "pluralCategories", CreateArrayFromList(pluralCategories)). + // 6. Perform ! CreateDataProperty(options, "pluralCategories", ! CreateArrayFromList(pluralCategories)). MUST(options->create_data_property_or_throw(vm.names.pluralCategories, Array::create_from(global_object, plural_categories))); // 7. Return options. diff --git a/Userland/Libraries/LibJS/Runtime/Intl/RelativeTimeFormat.cpp b/Userland/Libraries/LibJS/Runtime/Intl/RelativeTimeFormat.cpp index ed8c52450f..354e4afb52 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/RelativeTimeFormat.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/RelativeTimeFormat.cpp @@ -249,7 +249,7 @@ ThrowCompletionOr format_relative_time_to_parts(GlobalObject& global_obj // 1. Let parts be ? PartitionRelativeTimePattern(relativeTimeFormat, value, unit). auto parts = TRY(partition_relative_time_pattern(global_object, relative_time_format, value, unit)); - // 2. Let result be ArrayCreate(0). + // 2. Let result be ! ArrayCreate(0). auto* result = MUST(Array::create(global_object, 0)); // 3. Let n be 0. @@ -257,7 +257,7 @@ ThrowCompletionOr format_relative_time_to_parts(GlobalObject& global_obj // 4. For each Record { [[Type]], [[Value]], [[Unit]] } part in parts, do for (auto& part : parts) { - // a. Let O be OrdinaryObjectCreate(%Object.prototype%). + // a. Let O be ! OrdinaryObjectCreate(%Object.prototype%). auto* object = Object::create(global_object, global_object.object_prototype()); // b. Perform ! CreateDataPropertyOrThrow(O, "type", part.[[Type]]).