diff --git a/Userland/Libraries/LibJS/Runtime/GlobalObject.h b/Userland/Libraries/LibJS/Runtime/GlobalObject.h index 0557038477..94aa241d92 100644 --- a/Userland/Libraries/LibJS/Runtime/GlobalObject.h +++ b/Userland/Libraries/LibJS/Runtime/GlobalObject.h @@ -38,11 +38,6 @@ private: JS_DECLARE_NATIVE_FUNCTION(unescape); }; -inline GlobalObject* Shape::global_object() const -{ - return &static_cast(m_realm.global_object()); -} - template<> inline bool Object::fast_is() const { return is_global_object(); } diff --git a/Userland/Libraries/LibJS/Runtime/Object.cpp b/Userland/Libraries/LibJS/Runtime/Object.cpp index 7c1daa32b0..6e650d5e09 100644 --- a/Userland/Libraries/LibJS/Runtime/Object.cpp +++ b/Userland/Libraries/LibJS/Runtime/Object.cpp @@ -34,11 +34,6 @@ Object* Object::create(Realm& realm, Object* prototype) return realm.heap().allocate(realm, *prototype); } -GlobalObject& Object::global_object() const -{ - return *shape().global_object(); -} - Object::Object(GlobalObjectTag, Realm& realm) { // This is the global object diff --git a/Userland/Libraries/LibJS/Runtime/Object.h b/Userland/Libraries/LibJS/Runtime/Object.h index 27491d9ec7..8dd728acfe 100644 --- a/Userland/Libraries/LibJS/Runtime/Object.h +++ b/Userland/Libraries/LibJS/Runtime/Object.h @@ -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 diff --git a/Userland/Libraries/LibJS/Runtime/Shape.cpp b/Userland/Libraries/LibJS/Runtime/Shape.cpp index 6cf2e2a506..a4243d4a29 100644 --- a/Userland/Libraries/LibJS/Runtime/Shape.cpp +++ b/Userland/Libraries/LibJS/Runtime/Shape.cpp @@ -5,8 +5,8 @@ */ #include -#include #include +#include namespace JS { diff --git a/Userland/Libraries/LibJS/Runtime/Shape.h b/Userland/Libraries/LibJS/Runtime/Shape.h index 9f380788fd..01e9a81ff7 100644 --- a/Userland/Libraries/LibJS/Runtime/Shape.h +++ b/Userland/Libraries/LibJS/Runtime/Shape.h @@ -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; } diff --git a/Userland/Libraries/LibWeb/Bindings/IDLAbstractOperations.h b/Userland/Libraries/LibWeb/Bindings/IDLAbstractOperations.h index fd26395b5c..0f7ea9226a 100644 --- a/Userland/Libraries/LibWeb/Bindings/IDLAbstractOperations.h +++ b/Userland/Libraries/LibWeb/Bindings/IDLAbstractOperations.h @@ -129,7 +129,7 @@ JS::Completion invoke_callback(Bindings::CallbackType& callback, Optional arguments_list { function_object->global_object().heap() }; + JS::MarkedVector arguments_list { function_object->vm().heap() }; (arguments_list.append(forward(args)), ...); return invoke_callback(callback, move(this_argument), move(arguments_list)); diff --git a/Userland/Libraries/LibWeb/Bindings/LocationObject.cpp b/Userland/Libraries/LibWeb/Bindings/LocationObject.cpp index f063bb7ece..c7bb3ef343 100644 --- a/Userland/Libraries/LibWeb/Bindings/LocationObject.cpp +++ b/Userland/Libraries/LibWeb/Bindings/LocationObject.cpp @@ -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(global_object()).impl().browsing_context(); + auto* browsing_context = verify_cast(HTML::relevant_global_object(*this)).impl().browsing_context(); return browsing_context ? browsing_context->active_document() : nullptr; }