summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormatConstructor.cpp
diff options
context:
space:
mode:
authorTimothy Flynn <trflynn89@pm.me>2023-01-28 12:33:35 -0500
committerLinus Groh <mail@linusgroh.de>2023-01-29 00:02:45 +0000
commit2692db869963ed10947b05f13eade5fcbd5951dc (patch)
treeef12b9e76ff4edb64571819643a92d8e6c33a2fe /Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormatConstructor.cpp
parent1c1b902a6a0c1c7017fdc6d9748018317a554c9b (diff)
downloadserenity-2692db869963ed10947b05f13eade5fcbd5951dc.zip
LibJS+Everywhere: Allow Cell::initialize overrides to throw OOM errors
Note that as of this commit, there aren't any such throwers, and the call site in Heap::allocate will drop exceptions on the floor. This commit only serves to change the declaration of the overrides, make sure they return an empty value, and to propagate OOM errors frm their base initialize invocations.
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormatConstructor.cpp')
-rw-r--r--Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormatConstructor.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormatConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormatConstructor.cpp
index 71e803d482..6a1a43dfe5 100644
--- a/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormatConstructor.cpp
+++ b/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormatConstructor.cpp
@@ -23,9 +23,9 @@ DateTimeFormatConstructor::DateTimeFormatConstructor(Realm& realm)
{
}
-void DateTimeFormatConstructor::initialize(Realm& realm)
+ThrowCompletionOr<void> DateTimeFormatConstructor::initialize(Realm& realm)
{
- NativeFunction::initialize(realm);
+ MUST_OR_THROW_OOM(NativeFunction::initialize(realm));
auto& vm = this->vm();
@@ -36,6 +36,8 @@ void DateTimeFormatConstructor::initialize(Realm& realm)
define_native_function(realm, vm.names.supportedLocalesOf, supported_locales_of, 1, attr);
define_direct_property(vm.names.length, Value(0), Attribute::Configurable);
+
+ return {};
}
// 11.1.1 Intl.DateTimeFormat ( [ locales [ , options ] ] ), https://tc39.es/ecma402/#sec-intl.datetimeformat