mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 12:48:10 +00:00
LibJS: Remove GlobalObject::{set_,}associated_realm()
This commit is contained in:
parent
61bd9fef7d
commit
dfb7588d30
5 changed files with 0 additions and 20 deletions
|
@ -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());
|
||||||
}
|
}
|
||||||
|
|
|
@ -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__
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue