summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS/Contrib
diff options
context:
space:
mode:
Diffstat (limited to 'Userland/Libraries/LibJS/Contrib')
-rw-r--r--Userland/Libraries/LibJS/Contrib/Test262/$262Object.cpp4
-rw-r--r--Userland/Libraries/LibJS/Contrib/Test262/GlobalObject.cpp5
-rw-r--r--Userland/Libraries/LibJS/Contrib/Test262/GlobalObject.h4
3 files changed, 6 insertions, 7 deletions
diff --git a/Userland/Libraries/LibJS/Contrib/Test262/$262Object.cpp b/Userland/Libraries/LibJS/Contrib/Test262/$262Object.cpp
index 54a31f7ae8..74e7568ac7 100644
--- a/Userland/Libraries/LibJS/Contrib/Test262/$262Object.cpp
+++ b/Userland/Libraries/LibJS/Contrib/Test262/$262Object.cpp
@@ -23,7 +23,7 @@ $262Object::$262Object(Realm& realm)
{
}
-void $262Object::initialize(JS::Realm& realm)
+void $262Object::initialize(Realm& realm)
{
Base::initialize(realm);
@@ -63,7 +63,7 @@ JS_DEFINE_NATIVE_FUNCTION($262Object::create_realm)
VERIFY(realm_global_object);
realm->set_global_object(realm_global_object, nullptr);
realm_global_object->set_associated_realm(*realm);
- realm_global_object->initialize_global_object();
+ realm_global_object->initialize_global_object(*realm);
return Value(realm_global_object->$262());
}
diff --git a/Userland/Libraries/LibJS/Contrib/Test262/GlobalObject.cpp b/Userland/Libraries/LibJS/Contrib/Test262/GlobalObject.cpp
index da196c73da..4d2e7c0841 100644
--- a/Userland/Libraries/LibJS/Contrib/Test262/GlobalObject.cpp
+++ b/Userland/Libraries/LibJS/Contrib/Test262/GlobalObject.cpp
@@ -14,11 +14,10 @@
namespace JS::Test262 {
-void GlobalObject::initialize_global_object()
+void GlobalObject::initialize_global_object(Realm& realm)
{
- Base::initialize_global_object();
+ Base::initialize_global_object(realm);
- auto& realm = *associated_realm();
m_$262 = vm().heap().allocate<$262Object>(realm, realm);
// https://github.com/tc39/test262/blob/master/INTERPRETING.md#host-defined-functions
diff --git a/Userland/Libraries/LibJS/Contrib/Test262/GlobalObject.h b/Userland/Libraries/LibJS/Contrib/Test262/GlobalObject.h
index 359f5b5036..168467d0b6 100644
--- a/Userland/Libraries/LibJS/Contrib/Test262/GlobalObject.h
+++ b/Userland/Libraries/LibJS/Contrib/Test262/GlobalObject.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021, Linus Groh <linusg@serenityos.org>
+ * Copyright (c) 2021-2022, Linus Groh <linusg@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
@@ -19,7 +19,7 @@ public:
: JS::GlobalObject(realm)
{
}
- virtual void initialize_global_object() override;
+ virtual void initialize_global_object(Realm&) override;
virtual ~GlobalObject() override = default;
$262Object* $262() const { return m_$262; }