1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 18:18:12 +00:00

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

This commit is contained in:
Linus Groh 2022-08-27 01:07:00 +01:00
parent 61bd9fef7d
commit dfb7588d30
5 changed files with 0 additions and 20 deletions

View file

@ -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());
}

View file

@ -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__

View file

@ -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

View file

@ -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;

View file

@ -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();