summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS/Runtime/RegExpConstructor.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/RegExpConstructor.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/RegExpConstructor.cpp')
-rw-r--r--Userland/Libraries/LibJS/Runtime/RegExpConstructor.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/RegExpConstructor.cpp b/Userland/Libraries/LibJS/Runtime/RegExpConstructor.cpp
index c95ca2c937..b40387d28d 100644
--- a/Userland/Libraries/LibJS/Runtime/RegExpConstructor.cpp
+++ b/Userland/Libraries/LibJS/Runtime/RegExpConstructor.cpp
@@ -24,7 +24,7 @@ void RegExpConstructor::initialize(Realm& realm)
// 22.2.4.1 RegExp.prototype, https://tc39.es/ecma262/#sec-regexp.prototype
define_direct_property(vm.names.prototype, realm.global_object().regexp_prototype(), 0);
- define_native_accessor(*vm.well_known_symbol_species(), symbol_species_getter, {}, Attribute::Configurable);
+ define_native_accessor(realm, *vm.well_known_symbol_species(), symbol_species_getter, {}, Attribute::Configurable);
define_direct_property(vm.names.length, Value(2), Attribute::Configurable);
}