Pārlūkot izejas kodu

LibJS: Remove GlobalObject::{set_,}associated_realm()

Linus Groh 2 gadi atpakaļ
vecāks
revīzija
dfb7588d30

+ 0 - 1
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);
     auto* realm_global_object = vm.heap().allocate_without_realm<GlobalObject>(*realm);
     VERIFY(realm_global_object);
     VERIFY(realm_global_object);
     realm->set_global_object(realm_global_object, nullptr);
     realm->set_global_object(realm_global_object, nullptr);
-    realm_global_object->set_associated_realm(*realm);
     realm_global_object->initialize_global_object(*realm);
     realm_global_object->initialize_global_object(*realm);
     return Value(realm_global_object->$262());
     return Value(realm_global_object->$262());
 }
 }

+ 0 - 11
Userland/Libraries/LibJS/Runtime/GlobalObject.cpp

@@ -183,17 +183,6 @@ void GlobalObject::initialize_global_object(Realm& realm)
 
 
 GlobalObject::~GlobalObject() = default;
 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)
 JS_DEFINE_NATIVE_FUNCTION(GlobalObject::gc)
 {
 {
 #ifdef __serenity__
 #ifdef __serenity__

+ 0 - 4
Userland/Libraries/LibJS/Runtime/GlobalObject.h

@@ -24,9 +24,6 @@ public:
 
 
     Console& console() { return *m_console; }
     Console& console() { return *m_console; }
 
 
-    Realm* associated_realm();
-    void set_associated_realm(Realm&);
-
 private:
 private:
     virtual bool is_global_object() const final { return true; }
     virtual bool is_global_object() const final { return true; }
 
 
@@ -44,7 +41,6 @@ private:
     JS_DECLARE_NATIVE_FUNCTION(unescape);
     JS_DECLARE_NATIVE_FUNCTION(unescape);
 
 
     NonnullOwnPtr<Console> m_console;
     NonnullOwnPtr<Console> m_console;
-    WeakPtr<Realm> m_associated_realm;
 };
 };
 
 
 inline GlobalObject* Shape::global_object() const
 inline GlobalObject* Shape::global_object() const

+ 0 - 3
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.
     // 2. Assert: Type(globalObj) is Object.
     VERIFY(global_object);
     VERIFY(global_object);
 
 
-    // Non-standard
-    global_object->set_associated_realm(*this);
-
     // 3. If thisValue is undefined, set thisValue to globalObj.
     // 3. If thisValue is undefined, set thisValue to globalObj.
     if (this_value == nullptr)
     if (this_value == nullptr)
         this_value = global_object;
         this_value = global_object;

+ 0 - 1
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().
     // It gets removed immediately after creating the interpreter in Document::interpreter().
     auto& eso = verify_cast<Web::HTML::EnvironmentSettingsObject>(*realm.host_defined());
     auto& eso = verify_cast<Web::HTML::EnvironmentSettingsObject>(*realm.host_defined());
     vm.push_execution_context(eso.realm_execution_context());
     vm.push_execution_context(eso.realm_execution_context());
-    console_global_object->set_associated_realm(realm);
     console_global_object->initialize_global_object(realm);
     console_global_object->initialize_global_object(realm);
     vm.pop_execution_context();
     vm.pop_execution_context();