summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS/Runtime/AsyncGeneratorFunctionConstructor.cpp
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2022-08-16 00:20:49 +0100
committerLinus Groh <mail@linusgroh.de>2022-08-23 13:58:30 +0100
commit5dd5896588b0e5a7bc7bdadeaa7dd4865f663b79 (patch)
treeb8c099aac88ad59a9fb06624fd6245f9662a9796 /Userland/Libraries/LibJS/Runtime/AsyncGeneratorFunctionConstructor.cpp
parentecd163bdf1cbf8c9bca9e209a385a41ff5ca4f81 (diff)
downloadserenity-5dd5896588b0e5a7bc7bdadeaa7dd4865f663b79.zip
LibJS+LibWeb: Replace GlobalObject with Realm in initialize() functions
This is a continuation of the previous commit. Calling initialize() is the first thing that's done after allocating a cell on the JS heap - and in the common case of allocating an object, that's where properties are assigned and intrinsics occasionally accessed. Since those are supposed to live on the realm eventually, this is another step into that direction.
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime/AsyncGeneratorFunctionConstructor.cpp')
-rw-r--r--Userland/Libraries/LibJS/Runtime/AsyncGeneratorFunctionConstructor.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/AsyncGeneratorFunctionConstructor.cpp b/Userland/Libraries/LibJS/Runtime/AsyncGeneratorFunctionConstructor.cpp
index 0341bd3313..e3e49e2dd6 100644
--- a/Userland/Libraries/LibJS/Runtime/AsyncGeneratorFunctionConstructor.cpp
+++ b/Userland/Libraries/LibJS/Runtime/AsyncGeneratorFunctionConstructor.cpp
@@ -17,16 +17,16 @@ AsyncGeneratorFunctionConstructor::AsyncGeneratorFunctionConstructor(Realm& real
{
}
-void AsyncGeneratorFunctionConstructor::initialize(GlobalObject& global_object)
+void AsyncGeneratorFunctionConstructor::initialize(Realm& realm)
{
auto& vm = this->vm();
- NativeFunction::initialize(global_object);
+ NativeFunction::initialize(realm);
// 27.4.2.1 AsyncGeneratorFunction.length, https://tc39.es/ecma262/#sec-asyncgeneratorfunction-length
define_direct_property(vm.names.length, Value(1), Attribute::Configurable);
// 27.4.2.2 AsyncGeneratorFunction.prototype, https://tc39.es/ecma262/#sec-asyncgeneratorfunction-prototype
- define_direct_property(vm.names.prototype, global_object.async_generator_function_prototype(), 0);
+ define_direct_property(vm.names.prototype, realm.global_object().async_generator_function_prototype(), 0);
}
// 27.4.1.1 AsyncGeneratorFunction ( p1, p2, … , pn, body ), https://tc39.es/ecma262/#sec-asyncgeneratorfunction