diff options
-rw-r--r-- | Userland/Libraries/LibWeb/DOM/Comment.cpp | 9 | ||||
-rw-r--r-- | Userland/Libraries/LibWeb/DOM/Comment.h | 2 |
2 files changed, 11 insertions, 0 deletions
diff --git a/Userland/Libraries/LibWeb/DOM/Comment.cpp b/Userland/Libraries/LibWeb/DOM/Comment.cpp index cbd4ac1448..1a8794837c 100644 --- a/Userland/Libraries/LibWeb/DOM/Comment.cpp +++ b/Userland/Libraries/LibWeb/DOM/Comment.cpp @@ -4,6 +4,7 @@ * SPDX-License-Identifier: BSD-2-Clause */ +#include <LibWeb/Bindings/CommentPrototype.h> #include <LibWeb/DOM/Comment.h> #include <LibWeb/HTML/Window.h> #include <LibWeb/Layout/TextNode.h> @@ -22,4 +23,12 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<Comment>> Comment::construct_impl(JS::Realm return MUST_OR_THROW_OOM(realm.heap().allocate<Comment>(realm, window.associated_document(), data)); } +JS::ThrowCompletionOr<void> Comment::initialize(JS::Realm& realm) +{ + MUST_OR_THROW_OOM(Base::initialize(realm)); + set_prototype(&Bindings::ensure_web_prototype<Bindings::CommentPrototype>(realm, "Comment")); + + return {}; +} + } diff --git a/Userland/Libraries/LibWeb/DOM/Comment.h b/Userland/Libraries/LibWeb/DOM/Comment.h index 0b509672c7..b0fe1d482e 100644 --- a/Userland/Libraries/LibWeb/DOM/Comment.h +++ b/Userland/Libraries/LibWeb/DOM/Comment.h @@ -22,6 +22,8 @@ public: private: Comment(Document&, DeprecatedString const&); + + virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override; }; template<> |