diff --git a/Userland/Libraries/LibJS/Runtime/Intl/ListFormatConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Intl/ListFormatConstructor.cpp index 6aea4da788..a75cd79a2f 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/ListFormatConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/ListFormatConstructor.cpp @@ -30,7 +30,7 @@ void ListFormatConstructor::initialize(GlobalObject& global_object) define_direct_property(vm.names.prototype, global_object.intl_list_format_prototype(), 0); u8 attr = Attribute::Writable | Attribute::Configurable; - define_old_native_function(vm.names.supportedLocalesOf, supported_locales_of, 1, attr); + define_native_function(vm.names.supportedLocalesOf, supported_locales_of, 1, attr); define_direct_property(vm.names.length, Value(0), Attribute::Configurable); } @@ -96,7 +96,7 @@ ThrowCompletionOr ListFormatConstructor::construct(FunctionObject& new_ } // 13.3.2 Intl.ListFormat.supportedLocalesOf ( locales [ , options ] ), https://tc39.es/ecma402/#sec-Intl.ListFormat.supportedLocalesOf -JS_DEFINE_OLD_NATIVE_FUNCTION(ListFormatConstructor::supported_locales_of) +JS_DEFINE_NATIVE_FUNCTION(ListFormatConstructor::supported_locales_of) { auto locales = vm.argument(0); auto options = vm.argument(1); @@ -104,10 +104,10 @@ JS_DEFINE_OLD_NATIVE_FUNCTION(ListFormatConstructor::supported_locales_of) // 1. Let availableLocales be %ListFormat%.[[AvailableLocales]]. // 2. Let requestedLocales be ? CanonicalizeLocaleList(locales). - auto requested_locales = TRY_OR_DISCARD(canonicalize_locale_list(global_object, locales)); + auto requested_locales = TRY(canonicalize_locale_list(global_object, locales)); // 3. Return ? SupportedLocales(availableLocales, requestedLocales, options). - return TRY_OR_DISCARD(supported_locales(global_object, requested_locales, options)); + return TRY(supported_locales(global_object, requested_locales, options)); } } diff --git a/Userland/Libraries/LibJS/Runtime/Intl/ListFormatConstructor.h b/Userland/Libraries/LibJS/Runtime/Intl/ListFormatConstructor.h index 4a70ae9398..7e50c7bb1d 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/ListFormatConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/Intl/ListFormatConstructor.h @@ -24,7 +24,7 @@ public: private: virtual bool has_constructor() const override { return true; } - JS_DECLARE_OLD_NATIVE_FUNCTION(supported_locales_of); + JS_DECLARE_NATIVE_FUNCTION(supported_locales_of); }; } diff --git a/Userland/Libraries/LibJS/Runtime/Intl/ListFormatPrototype.cpp b/Userland/Libraries/LibJS/Runtime/Intl/ListFormatPrototype.cpp index b42ab39d6f..bb0e3b7c9a 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/ListFormatPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/ListFormatPrototype.cpp @@ -28,22 +28,22 @@ void ListFormatPrototype::initialize(GlobalObject& global_object) define_direct_property(*vm.well_known_symbol_to_string_tag(), js_string(vm, "Intl.ListFormat"), Attribute::Configurable); u8 attr = Attribute::Writable | Attribute::Configurable; - define_old_native_function(vm.names.format, format, 1, attr); - define_old_native_function(vm.names.formatToParts, format_to_parts, 1, attr); - define_old_native_function(vm.names.resolvedOptions, resolved_options, 0, attr); + define_native_function(vm.names.format, format, 1, attr); + define_native_function(vm.names.formatToParts, format_to_parts, 1, attr); + define_native_function(vm.names.resolvedOptions, resolved_options, 0, attr); } // 13.4.3 Intl.ListFormat.prototype.format ( list ), https://tc39.es/ecma402/#sec-Intl.ListFormat.prototype.format -JS_DEFINE_OLD_NATIVE_FUNCTION(ListFormatPrototype::format) +JS_DEFINE_NATIVE_FUNCTION(ListFormatPrototype::format) { auto list = vm.argument(0); // 1. Let lf be the this value. // 2. Perform ? RequireInternalSlot(lf, [[InitializedListFormat]]). - auto* list_format = TRY_OR_DISCARD(typed_this_object(global_object)); + auto* list_format = TRY(typed_this_object(global_object)); // 3. Let stringList be ? StringListFromIterable(list). - auto string_list = TRY_OR_DISCARD(string_list_from_iterable(global_object, list)); + auto string_list = TRY(string_list_from_iterable(global_object, list)); // 4. Return FormatList(lf, stringList). auto formatted = format_list(*list_format, string_list); @@ -51,27 +51,27 @@ JS_DEFINE_OLD_NATIVE_FUNCTION(ListFormatPrototype::format) } // 13.4.4 Intl.ListFormat.prototype.formatToParts ( list ), https://tc39.es/ecma402/#sec-Intl.ListFormat.prototype.formatToParts -JS_DEFINE_OLD_NATIVE_FUNCTION(ListFormatPrototype::format_to_parts) +JS_DEFINE_NATIVE_FUNCTION(ListFormatPrototype::format_to_parts) { auto list = vm.argument(0); // 1. Let lf be the this value. // 2. Perform ? RequireInternalSlot(lf, [[InitializedListFormat]]). - auto* list_format = TRY_OR_DISCARD(typed_this_object(global_object)); + auto* list_format = TRY(typed_this_object(global_object)); // 3. Let stringList be ? StringListFromIterable(list). - auto string_list = TRY_OR_DISCARD(string_list_from_iterable(global_object, list)); + auto string_list = TRY(string_list_from_iterable(global_object, list)); // 4. Return FormatListToParts(lf, stringList). return format_list_to_parts(global_object, *list_format, string_list); } // 13.4.5 Intl.ListFormat.prototype.resolvedOptions ( ), https://tc39.es/ecma402/#sec-Intl.ListFormat.prototype.resolvedoptions -JS_DEFINE_OLD_NATIVE_FUNCTION(ListFormatPrototype::resolved_options) +JS_DEFINE_NATIVE_FUNCTION(ListFormatPrototype::resolved_options) { // 1. Let lf be the this value. // 2. Perform ? RequireInternalSlot(lf, [[InitializedListFormat]]). - auto* list_format = TRY_OR_DISCARD(typed_this_object(global_object)); + auto* list_format = TRY(typed_this_object(global_object)); // 3. Let options be ! OrdinaryObjectCreate(%Object.prototype%). auto* options = Object::create(global_object, global_object.object_prototype()); diff --git a/Userland/Libraries/LibJS/Runtime/Intl/ListFormatPrototype.h b/Userland/Libraries/LibJS/Runtime/Intl/ListFormatPrototype.h index 350225e656..1761b7c129 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/ListFormatPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/Intl/ListFormatPrototype.h @@ -20,9 +20,9 @@ public: virtual ~ListFormatPrototype() override = default; private: - JS_DECLARE_OLD_NATIVE_FUNCTION(format); - JS_DECLARE_OLD_NATIVE_FUNCTION(format_to_parts); - JS_DECLARE_OLD_NATIVE_FUNCTION(resolved_options); + JS_DECLARE_NATIVE_FUNCTION(format); + JS_DECLARE_NATIVE_FUNCTION(format_to_parts); + JS_DECLARE_NATIVE_FUNCTION(resolved_options); }; }