summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS/Runtime/NumberConstructor.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/NumberConstructor.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/NumberConstructor.cpp')
-rw-r--r--Userland/Libraries/LibJS/Runtime/NumberConstructor.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/NumberConstructor.cpp b/Userland/Libraries/LibJS/Runtime/NumberConstructor.cpp
index 9a56419f29..bbff170620 100644
--- a/Userland/Libraries/LibJS/Runtime/NumberConstructor.cpp
+++ b/Userland/Libraries/LibJS/Runtime/NumberConstructor.cpp
@@ -37,10 +37,10 @@ void NumberConstructor::initialize(Realm& realm)
define_direct_property(vm.names.prototype, realm.global_object().number_prototype(), 0);
u8 attr = Attribute::Writable | Attribute::Configurable;
- define_native_function(vm.names.isFinite, is_finite, 1, attr);
- define_native_function(vm.names.isInteger, is_integer, 1, attr);
- define_native_function(vm.names.isNaN, is_nan, 1, attr);
- define_native_function(vm.names.isSafeInteger, is_safe_integer, 1, attr);
+ define_native_function(realm, vm.names.isFinite, is_finite, 1, attr);
+ define_native_function(realm, vm.names.isInteger, is_integer, 1, attr);
+ define_native_function(realm, vm.names.isNaN, is_nan, 1, attr);
+ define_native_function(realm, vm.names.isSafeInteger, is_safe_integer, 1, attr);
// FIXME: Store these as intrinsics (`parse_int_function()`) instead of getting them from the global object
define_direct_property(vm.names.parseInt, realm.global_object().get_without_side_effects(vm.names.parseInt), attr);
define_direct_property(vm.names.parseFloat, realm.global_object().get_without_side_effects(vm.names.parseFloat), attr);