mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 04:18:12 +00:00
LibJS+LibWeb: Remove last uses of GlobalObject::associated_realm()
This commit is contained in:
parent
50428ea8d2
commit
61bd9fef7d
3 changed files with 4 additions and 5 deletions
|
@ -61,7 +61,7 @@ ECMAScriptFunctionObject::ECMAScriptFunctionObject(FlyString name, String source
|
||||||
, m_private_environment(private_environment)
|
, m_private_environment(private_environment)
|
||||||
, m_formal_parameters(move(formal_parameters))
|
, m_formal_parameters(move(formal_parameters))
|
||||||
, m_ecmascript_code(ecmascript_code)
|
, m_ecmascript_code(ecmascript_code)
|
||||||
, m_realm(global_object().associated_realm())
|
, m_realm(&prototype.shape().realm())
|
||||||
, m_source_text(move(source_text))
|
, m_source_text(move(source_text))
|
||||||
, m_class_field_initializer_name(move(class_field_initializer_name))
|
, m_class_field_initializer_name(move(class_field_initializer_name))
|
||||||
, m_strict(strict)
|
, m_strict(strict)
|
||||||
|
|
|
@ -53,7 +53,7 @@ public:
|
||||||
auto it = m_prototypes.find(class_name);
|
auto it = m_prototypes.find(class_name);
|
||||||
if (it != m_prototypes.end())
|
if (it != m_prototypes.end())
|
||||||
return *it->value;
|
return *it->value;
|
||||||
auto& realm = *associated_realm();
|
auto& realm = shape().realm();
|
||||||
auto* prototype = heap().allocate<T>(realm, realm);
|
auto* prototype = heap().allocate<T>(realm, realm);
|
||||||
m_prototypes.set(class_name, prototype);
|
m_prototypes.set(class_name, prototype);
|
||||||
return *prototype;
|
return *prototype;
|
||||||
|
@ -65,7 +65,7 @@ public:
|
||||||
auto it = m_constructors.find(class_name);
|
auto it = m_constructors.find(class_name);
|
||||||
if (it != m_constructors.end())
|
if (it != m_constructors.end())
|
||||||
return *it->value;
|
return *it->value;
|
||||||
auto& realm = *associated_realm();
|
auto& realm = shape().realm();
|
||||||
auto* constructor = heap().allocate<T>(realm, realm);
|
auto* constructor = heap().allocate<T>(realm, realm);
|
||||||
m_constructors.set(class_name, constructor);
|
m_constructors.set(class_name, constructor);
|
||||||
define_direct_property(class_name, JS::Value(constructor), JS::Attribute::Writable | JS::Attribute::Configurable);
|
define_direct_property(class_name, JS::Value(constructor), JS::Attribute::Writable | JS::Attribute::Configurable);
|
||||||
|
|
|
@ -1081,8 +1081,7 @@ JS::Realm& Document::realm()
|
||||||
{
|
{
|
||||||
VERIFY(m_window);
|
VERIFY(m_window);
|
||||||
VERIFY(m_window->wrapper());
|
VERIFY(m_window->wrapper());
|
||||||
VERIFY(m_window->wrapper()->associated_realm());
|
return m_window->wrapper()->shape().realm();
|
||||||
return *m_window->wrapper()->associated_realm();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
JS::Interpreter& Document::interpreter()
|
JS::Interpreter& Document::interpreter()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue