diff options
author | Andreas Kling <kling@serenityos.org> | 2021-03-17 16:52:26 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-03-17 16:53:35 +0100 |
commit | d792200a5531bf9872e19c7c7a3ba4c865ad43b6 (patch) | |
tree | 3c29f8ef40f08033a7bf49d7539e911f97ffd269 /Userland/Libraries | |
parent | ea81dc13cf961fc7963fc3bc8584479c5f82a55e (diff) | |
download | serenity-d792200a5531bf9872e19c7c7a3ba4c865ad43b6.zip |
LibJS: Rename GlobalObject::initialize() => initialize_global_object()
This function was shadowing Object::initialize() which cannot be called
on global objects and has a different set of parameters.
Diffstat (limited to 'Userland/Libraries')
-rw-r--r-- | Userland/Libraries/LibJS/Interpreter.h | 2 | ||||
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/GlobalObject.cpp | 2 | ||||
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/GlobalObject.h | 2 | ||||
-rw-r--r-- | Userland/Libraries/LibWeb/Bindings/WindowObject.cpp | 4 | ||||
-rw-r--r-- | Userland/Libraries/LibWeb/Bindings/WindowObject.h | 5 |
5 files changed, 8 insertions, 7 deletions
diff --git a/Userland/Libraries/LibJS/Interpreter.h b/Userland/Libraries/LibJS/Interpreter.h index b84b980662..5efb1428da 100644 --- a/Userland/Libraries/LibJS/Interpreter.h +++ b/Userland/Libraries/LibJS/Interpreter.h @@ -53,7 +53,7 @@ public: auto interpreter = adopt_own(*new Interpreter(vm)); VM::InterpreterExecutionScope scope(*interpreter); interpreter->m_global_object = make_handle(static_cast<Object*>(interpreter->heap().allocate_without_global_object<GlobalObjectType>(forward<Args>(args)...))); - static_cast<GlobalObjectType*>(interpreter->m_global_object.cell())->initialize(); + static_cast<GlobalObjectType*>(interpreter->m_global_object.cell())->initialize_global_object(); return interpreter; } diff --git a/Userland/Libraries/LibJS/Runtime/GlobalObject.cpp b/Userland/Libraries/LibJS/Runtime/GlobalObject.cpp index 2b0a01bcc4..e7e0ac9b00 100644 --- a/Userland/Libraries/LibJS/Runtime/GlobalObject.cpp +++ b/Userland/Libraries/LibJS/Runtime/GlobalObject.cpp @@ -82,7 +82,7 @@ GlobalObject::GlobalObject() { } -void GlobalObject::initialize() +void GlobalObject::initialize_global_object() { auto& vm = this->vm(); diff --git a/Userland/Libraries/LibJS/Runtime/GlobalObject.h b/Userland/Libraries/LibJS/Runtime/GlobalObject.h index 791bde78ad..6261a23077 100644 --- a/Userland/Libraries/LibJS/Runtime/GlobalObject.h +++ b/Userland/Libraries/LibJS/Runtime/GlobalObject.h @@ -37,7 +37,7 @@ class GlobalObject : public ScopeObject { public: explicit GlobalObject(); - virtual void initialize(); + virtual void initialize_global_object(); virtual ~GlobalObject() override; diff --git a/Userland/Libraries/LibWeb/Bindings/WindowObject.cpp b/Userland/Libraries/LibWeb/Bindings/WindowObject.cpp index 81f1a36d3a..22f17862e6 100644 --- a/Userland/Libraries/LibWeb/Bindings/WindowObject.cpp +++ b/Userland/Libraries/LibWeb/Bindings/WindowObject.cpp @@ -56,9 +56,9 @@ WindowObject::WindowObject(DOM::Window& impl) impl.set_wrapper({}, *this); } -void WindowObject::initialize() +void WindowObject::initialize_global_object() { - GlobalObject::initialize(); + Base::initialize_global_object(); set_prototype(&ensure_web_prototype<EventTargetPrototype>("EventTarget")); diff --git a/Userland/Libraries/LibWeb/Bindings/WindowObject.h b/Userland/Libraries/LibWeb/Bindings/WindowObject.h index 097237bf03..94ffee1795 100644 --- a/Userland/Libraries/LibWeb/Bindings/WindowObject.h +++ b/Userland/Libraries/LibWeb/Bindings/WindowObject.h @@ -37,9 +37,11 @@ namespace Bindings { class WindowObject final : public JS::GlobalObject , public Weakable<WindowObject> { + JS_OBJECT(WindowObject, JS::GlobalObject); + public: explicit WindowObject(DOM::Window&); - virtual void initialize() override; + virtual void initialize_global_object() override; virtual ~WindowObject() override; DOM::Window& impl() { return *m_impl; } @@ -74,7 +76,6 @@ public: } private: - virtual const char* class_name() const override { return "WindowObject"; } virtual void visit_edges(Visitor&) override; JS_DECLARE_NATIVE_GETTER(document_getter); |