diff --git a/Userland/Libraries/LibJS/Runtime/Intl/NumberFormatConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Intl/NumberFormatConstructor.cpp index 99856f338e..78ced5128d 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/NumberFormatConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/NumberFormatConstructor.cpp @@ -29,7 +29,7 @@ void NumberFormatConstructor::initialize(GlobalObject& global_object) define_direct_property(vm.names.prototype, global_object.intl_number_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); } @@ -65,7 +65,7 @@ ThrowCompletionOr NumberFormatConstructor::construct(FunctionObject& ne } // 15.3.2 Intl.NumberFormat.supportedLocalesOf ( locales [ , options ] ), https://tc39.es/ecma402/#sec-intl.numberformat.supportedlocalesof -JS_DEFINE_OLD_NATIVE_FUNCTION(NumberFormatConstructor::supported_locales_of) +JS_DEFINE_NATIVE_FUNCTION(NumberFormatConstructor::supported_locales_of) { auto locales = vm.argument(0); auto options = vm.argument(1); @@ -73,10 +73,10 @@ JS_DEFINE_OLD_NATIVE_FUNCTION(NumberFormatConstructor::supported_locales_of) // 1. Let availableLocales be %NumberFormat%.[[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/NumberFormatConstructor.h b/Userland/Libraries/LibJS/Runtime/Intl/NumberFormatConstructor.h index 8e4a7e7e6e..7d2cb692ef 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/NumberFormatConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/Intl/NumberFormatConstructor.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/NumberFormatPrototype.cpp b/Userland/Libraries/LibJS/Runtime/Intl/NumberFormatPrototype.cpp index bdb3c9cae7..d3f59fbf76 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/NumberFormatPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/NumberFormatPrototype.cpp @@ -27,17 +27,17 @@ void NumberFormatPrototype::initialize(GlobalObject& global_object) define_direct_property(*vm.well_known_symbol_to_string_tag(), js_string(vm, "Intl.NumberFormat"), Attribute::Configurable); u8 attr = Attribute::Writable | Attribute::Configurable; - define_old_native_function(vm.names.resolvedOptions, resolved_options, 0, attr); + define_native_function(vm.names.resolvedOptions, resolved_options, 0, attr); } // 15.4.5 Intl.NumberFormat.prototype.resolvedOptions ( ), https://tc39.es/ecma402/#sec-intl.numberformat.prototype.resolvedoptions -JS_DEFINE_OLD_NATIVE_FUNCTION(NumberFormatPrototype::resolved_options) +JS_DEFINE_NATIVE_FUNCTION(NumberFormatPrototype::resolved_options) { // 1. Let nf be the this value. // 2. If the implementation supports the normative optional constructor mode of 4.3 Note 1, then // a. Set nf to ? UnwrapNumberFormat(nf). // 3. Perform ? RequireInternalSlot(nf, [[InitializedNumberFormat]]). - auto* number_format = TRY_OR_DISCARD(typed_this_object(global_object)); + auto* number_format = TRY(typed_this_object(global_object)); // 4. Let options be ! OrdinaryObjectCreate(%Object.prototype%). auto* options = Object::create(global_object, global_object.object_prototype()); diff --git a/Userland/Libraries/LibJS/Runtime/Intl/NumberFormatPrototype.h b/Userland/Libraries/LibJS/Runtime/Intl/NumberFormatPrototype.h index 0f79eb6557..16a7408c58 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/NumberFormatPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/Intl/NumberFormatPrototype.h @@ -20,7 +20,7 @@ public: virtual ~NumberFormatPrototype() override = default; private: - JS_DECLARE_OLD_NATIVE_FUNCTION(resolved_options); + JS_DECLARE_NATIVE_FUNCTION(resolved_options); }; }