summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS/Runtime/Temporal/Now.cpp
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2022-08-22 21:47:35 +0100
committerLinus Groh <mail@linusgroh.de>2022-08-23 13:58:30 +0100
commite3895e6c808d4606f02b26b1eaad3a3a803bba12 (patch)
treee3fe097d28b10f984df6cd67ca987a743cede389 /Userland/Libraries/LibJS/Runtime/Temporal/Now.cpp
parent7c468b5a772342243d1b306389c34ce485033392 (diff)
downloadserenity-e3895e6c808d4606f02b26b1eaad3a3a803bba12.zip
LibJS: Pass Realm to define_native_{accessor,function}()
This is needed so that the allocated NativeFunction receives the correct realm, usually forwarded from the Object's initialize() function, rather than using the current realm.
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime/Temporal/Now.cpp')
-rw-r--r--Userland/Libraries/LibJS/Runtime/Temporal/Now.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/Now.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/Now.cpp
index e732924a3f..2aa66dd3de 100644
--- a/Userland/Libraries/LibJS/Runtime/Temporal/Now.cpp
+++ b/Userland/Libraries/LibJS/Runtime/Temporal/Now.cpp
@@ -35,15 +35,15 @@ void Now::initialize(Realm& realm)
define_direct_property(*vm.well_known_symbol_to_string_tag(), js_string(vm, "Temporal.Now"), Attribute::Configurable);
u8 attr = Attribute::Writable | Attribute::Configurable;
- define_native_function(vm.names.timeZone, time_zone, 0, attr);
- define_native_function(vm.names.instant, instant, 0, attr);
- define_native_function(vm.names.plainDateTime, plain_date_time, 1, attr);
- define_native_function(vm.names.plainDateTimeISO, plain_date_time_iso, 0, attr);
- define_native_function(vm.names.zonedDateTime, zoned_date_time, 1, attr);
- define_native_function(vm.names.zonedDateTimeISO, zoned_date_time_iso, 0, attr);
- define_native_function(vm.names.plainDate, plain_date, 1, attr);
- define_native_function(vm.names.plainDateISO, plain_date_iso, 0, attr);
- define_native_function(vm.names.plainTimeISO, plain_time_iso, 0, attr);
+ define_native_function(realm, vm.names.timeZone, time_zone, 0, attr);
+ define_native_function(realm, vm.names.instant, instant, 0, attr);
+ define_native_function(realm, vm.names.plainDateTime, plain_date_time, 1, attr);
+ define_native_function(realm, vm.names.plainDateTimeISO, plain_date_time_iso, 0, attr);
+ define_native_function(realm, vm.names.zonedDateTime, zoned_date_time, 1, attr);
+ define_native_function(realm, vm.names.zonedDateTimeISO, zoned_date_time_iso, 0, attr);
+ define_native_function(realm, vm.names.plainDate, plain_date, 1, attr);
+ define_native_function(realm, vm.names.plainDateISO, plain_date_iso, 0, attr);
+ define_native_function(realm, vm.names.plainTimeISO, plain_time_iso, 0, attr);
}
// 2.2.1 Temporal.Now.timeZone ( ), https://tc39.es/proposal-temporal/#sec-temporal.now.timezone