diff options
author | Linus Groh <mail@linusgroh.de> | 2022-08-28 14:42:50 +0100 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2022-08-28 16:36:56 +0100 |
commit | cfa588585512540be5738b9b02511560a1126612 (patch) | |
tree | 059013bc0b3bb81c4d7bc792f326fc3402ffac51 /Userland/Services/WebContent | |
parent | 867ad039959e92b05b728f7a45d6793c34aa853f (diff) | |
download | serenity-cfa588585512540be5738b9b02511560a1126612.zip |
LibJS: Turn initialize_global_object() into a regular initialize()
There's nothing special about global object initialization anymore, this
can just work the same way as for any other object now.
Diffstat (limited to 'Userland/Services/WebContent')
-rw-r--r-- | Userland/Services/WebContent/ConsoleGlobalObject.cpp | 4 | ||||
-rw-r--r-- | Userland/Services/WebContent/ConsoleGlobalObject.h | 3 | ||||
-rw-r--r-- | Userland/Services/WebContent/WebContentConsoleClient.cpp | 2 |
3 files changed, 4 insertions, 5 deletions
diff --git a/Userland/Services/WebContent/ConsoleGlobalObject.cpp b/Userland/Services/WebContent/ConsoleGlobalObject.cpp index 6ab8d6949d..785c1e1855 100644 --- a/Userland/Services/WebContent/ConsoleGlobalObject.cpp +++ b/Userland/Services/WebContent/ConsoleGlobalObject.cpp @@ -20,9 +20,9 @@ ConsoleGlobalObject::ConsoleGlobalObject(JS::Realm& realm, Web::Bindings::Window { } -void ConsoleGlobalObject::initialize_global_object(JS::Realm& realm) +void ConsoleGlobalObject::initialize(JS::Realm& realm) { - Base::initialize_global_object(realm); + Base::initialize(realm); // $0 magic variable define_native_accessor(realm, "$0", inspected_node_getter, nullptr, 0); diff --git a/Userland/Services/WebContent/ConsoleGlobalObject.h b/Userland/Services/WebContent/ConsoleGlobalObject.h index 884ca4b4c7..49118ac68d 100644 --- a/Userland/Services/WebContent/ConsoleGlobalObject.h +++ b/Userland/Services/WebContent/ConsoleGlobalObject.h @@ -21,6 +21,7 @@ class ConsoleGlobalObject final : public JS::GlobalObject { public: ConsoleGlobalObject(JS::Realm&, Web::Bindings::WindowObject&); + virtual void initialize(JS::Realm&) override; virtual ~ConsoleGlobalObject() override = default; virtual JS::ThrowCompletionOr<Object*> internal_get_prototype_of() const override; @@ -35,8 +36,6 @@ public: virtual JS::ThrowCompletionOr<bool> internal_delete(JS::PropertyKey const& name) override; virtual JS::ThrowCompletionOr<JS::MarkedVector<JS::Value>> internal_own_property_keys() const override; - virtual void initialize_global_object(JS::Realm&) override; - private: virtual void visit_edges(Visitor&) override; diff --git a/Userland/Services/WebContent/WebContentConsoleClient.cpp b/Userland/Services/WebContent/WebContentConsoleClient.cpp index c048e9bc68..1e2218537b 100644 --- a/Userland/Services/WebContent/WebContentConsoleClient.cpp +++ b/Userland/Services/WebContent/WebContentConsoleClient.cpp @@ -33,7 +33,7 @@ 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->initialize_global_object(realm); + console_global_object->initialize(realm); vm.pop_execution_context(); m_console_global_object = JS::make_handle(console_global_object); |