1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 12:47:35 +00:00

LibJS: Remove Shape::global_object() and Object::global_object()

Same reason as in commit 275dea9.
This commit is contained in:
Linus Groh 2022-08-28 15:03:26 +01:00
parent 4f436bd323
commit 72730422bb
7 changed files with 3 additions and 16 deletions

View file

@ -38,11 +38,6 @@ private:
JS_DECLARE_NATIVE_FUNCTION(unescape);
};
inline GlobalObject* Shape::global_object() const
{
return &static_cast<GlobalObject&>(m_realm.global_object());
}
template<>
inline bool Object::fast_is<GlobalObject>() const { return is_global_object(); }

View file

@ -34,11 +34,6 @@ Object* Object::create(Realm& realm, Object* prototype)
return realm.heap().allocate<Object>(realm, *prototype);
}
GlobalObject& Object::global_object() const
{
return *shape().global_object();
}
Object::Object(GlobalObjectTag, Realm& realm)
{
// This is the global object

View file

@ -186,8 +186,6 @@ public:
Shape& shape() { return *m_shape; }
Shape const& shape() const { return *m_shape; }
GlobalObject& global_object() const;
void ensure_shape_is_unique();
template<typename T>

View file

@ -5,8 +5,8 @@
*/
#include <LibJS/Heap/DeferGC.h>
#include <LibJS/Runtime/GlobalObject.h>
#include <LibJS/Runtime/Shape.h>
#include <LibJS/Runtime/VM.h>
namespace JS {

View file

@ -62,7 +62,6 @@ public:
Shape* create_unique_clone() const;
Realm& realm() const { return m_realm; }
GlobalObject* global_object() const;
Object* prototype() { return m_prototype; }
Object const* prototype() const { return m_prototype; }

View file

@ -129,7 +129,7 @@ JS::Completion invoke_callback(Bindings::CallbackType& callback, Optional<JS::Va
auto* function_object = callback.callback.cell();
VERIFY(function_object);
JS::MarkedVector<JS::Value> arguments_list { function_object->global_object().heap() };
JS::MarkedVector<JS::Value> arguments_list { function_object->vm().heap() };
(arguments_list.append(forward<Args>(args)), ...);
return invoke_callback(callback, move(this_argument), move(arguments_list));

View file

@ -60,7 +60,7 @@ DOM::Document const* LocationObject::relevant_document() const
// A Location object has an associated relevant Document, which is this Location object's
// relevant global object's browsing context's active document, if this Location object's
// relevant global object's browsing context is non-null, and null otherwise.
auto* browsing_context = static_cast<WindowObject&>(global_object()).impl().browsing_context();
auto* browsing_context = verify_cast<WindowObject>(HTML::relevant_global_object(*this)).impl().browsing_context();
return browsing_context ? browsing_context->active_document() : nullptr;
}