summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/HTML/MessageChannel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Userland/Libraries/LibWeb/HTML/MessageChannel.cpp')
-rw-r--r--Userland/Libraries/LibWeb/HTML/MessageChannel.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/Userland/Libraries/LibWeb/HTML/MessageChannel.cpp b/Userland/Libraries/LibWeb/HTML/MessageChannel.cpp
index b0c706a57a..069564c3e2 100644
--- a/Userland/Libraries/LibWeb/HTML/MessageChannel.cpp
+++ b/Userland/Libraries/LibWeb/HTML/MessageChannel.cpp
@@ -19,8 +19,6 @@ JS::NonnullGCPtr<MessageChannel> MessageChannel::construct_impl(JS::Realm& realm
MessageChannel::MessageChannel(JS::Realm& realm)
: PlatformObject(realm)
{
- set_prototype(&Bindings::cached_web_prototype(realm, "MessageChannel"));
-
// 1. Set this's port 1 to a new MessagePort in this's relevant Realm.
m_port1 = MessagePort::create(realm);
@@ -40,6 +38,12 @@ void MessageChannel::visit_edges(Cell::Visitor& visitor)
visitor.visit(m_port2.ptr());
}
+void MessageChannel::initialize(JS::Realm& realm)
+{
+ Base::initialize(realm);
+ set_prototype(&Bindings::ensure_web_prototype<Bindings::MessageChannelPrototype>(realm, "MessageChannel"));
+}
+
MessagePort* MessageChannel::port1()
{
return m_port1;