diff options
author | Linus Groh <mail@linusgroh.de> | 2022-08-27 01:07:00 +0100 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2022-08-27 11:29:10 +0100 |
commit | dfb7588d300148ec72e1283947c4b37d71ffc460 (patch) | |
tree | fcb0eeeeb92aa1442a10face77437afbd58f741f | |
parent | 61bd9fef7d14b32e24c0d4d7841e569068d37629 (diff) | |
download | serenity-dfb7588d300148ec72e1283947c4b37d71ffc460.zip |
LibJS: Remove GlobalObject::{set_,}associated_realm()
5 files changed, 0 insertions, 20 deletions
diff --git a/Userland/Libraries/LibJS/Contrib/Test262/$262Object.cpp b/Userland/Libraries/LibJS/Contrib/Test262/$262Object.cpp index 5ed0dce364..b70b70abf9 100644 --- a/Userland/Libraries/LibJS/Contrib/Test262/$262Object.cpp +++ b/Userland/Libraries/LibJS/Contrib/Test262/$262Object.cpp @@ -62,7 +62,6 @@ JS_DEFINE_NATIVE_FUNCTION($262Object::create_realm) auto* realm_global_object = vm.heap().allocate_without_realm<GlobalObject>(*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); return Value(realm_global_object->$262()); } diff --git a/Userland/Libraries/LibJS/Runtime/GlobalObject.cpp b/Userland/Libraries/LibJS/Runtime/GlobalObject.cpp index 2a5fdd3446..68a253b537 100644 --- a/Userland/Libraries/LibJS/Runtime/GlobalObject.cpp +++ b/Userland/Libraries/LibJS/Runtime/GlobalObject.cpp @@ -183,17 +183,6 @@ void GlobalObject::initialize_global_object(Realm& realm) GlobalObject::~GlobalObject() = default; -Realm* GlobalObject::associated_realm() -{ - return m_associated_realm; -} - -void GlobalObject::set_associated_realm(Realm& realm) -{ - VERIFY(&realm == &shape().realm()); - m_associated_realm = &realm; -} - JS_DEFINE_NATIVE_FUNCTION(GlobalObject::gc) { #ifdef __serenity__ diff --git a/Userland/Libraries/LibJS/Runtime/GlobalObject.h b/Userland/Libraries/LibJS/Runtime/GlobalObject.h index 6222fcba75..49496bae8e 100644 --- a/Userland/Libraries/LibJS/Runtime/GlobalObject.h +++ b/Userland/Libraries/LibJS/Runtime/GlobalObject.h @@ -24,9 +24,6 @@ public: Console& console() { return *m_console; } - Realm* associated_realm(); - void set_associated_realm(Realm&); - private: virtual bool is_global_object() const final { return true; } @@ -44,7 +41,6 @@ private: JS_DECLARE_NATIVE_FUNCTION(unescape); NonnullOwnPtr<Console> m_console; - WeakPtr<Realm> m_associated_realm; }; inline GlobalObject* Shape::global_object() const diff --git a/Userland/Libraries/LibJS/Runtime/Realm.cpp b/Userland/Libraries/LibJS/Runtime/Realm.cpp index 03038f3127..a855589793 100644 --- a/Userland/Libraries/LibJS/Runtime/Realm.cpp +++ b/Userland/Libraries/LibJS/Runtime/Realm.cpp @@ -96,9 +96,6 @@ void Realm::set_global_object(GlobalObject* global_object, GlobalObject* this_va // 2. Assert: Type(globalObj) is Object. VERIFY(global_object); - // Non-standard - global_object->set_associated_realm(*this); - // 3. If thisValue is undefined, set thisValue to globalObj. if (this_value == nullptr) this_value = global_object; diff --git a/Userland/Services/WebContent/WebContentConsoleClient.cpp b/Userland/Services/WebContent/WebContentConsoleClient.cpp index a94c1ff774..c048e9bc68 100644 --- a/Userland/Services/WebContent/WebContentConsoleClient.cpp +++ b/Userland/Services/WebContent/WebContentConsoleClient.cpp @@ -33,7 +33,6 @@ WebContentConsoleClient::WebContentConsoleClient(JS::Console& console, WeakPtr<J // It gets removed immediately after creating the interpreter in Document::interpreter(). auto& eso = verify_cast<Web::HTML::EnvironmentSettingsObject>(*realm.host_defined()); vm.push_execution_context(eso.realm_execution_context()); - console_global_object->set_associated_realm(realm); console_global_object->initialize_global_object(realm); vm.pop_execution_context(); |