summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb
diff options
context:
space:
mode:
authorLuke Wilde <lukew@serenityos.org>2022-07-11 14:24:14 +0100
committerLinus Groh <mail@linusgroh.de>2022-07-11 14:49:25 +0100
commit38696dc6269517bcc782eebe5d1490d8755494ac (patch)
tree032a5ae78da223afddfaf3c3df2fe9f8594a8735 /Userland/Libraries/LibWeb
parent7b89c4e4122f33f16c9f312d6ff604cda97360f2 (diff)
downloadserenity-38696dc6269517bcc782eebe5d1490d8755494ac.zip
LibWeb: Store MessageEvent::m_data in a JS::Handle
This protects it from GC.
Diffstat (limited to 'Userland/Libraries/LibWeb')
-rw-r--r--Userland/Libraries/LibWeb/HTML/MessageEvent.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/Userland/Libraries/LibWeb/HTML/MessageEvent.h b/Userland/Libraries/LibWeb/HTML/MessageEvent.h
index e08c001eb0..334bfb41aa 100644
--- a/Userland/Libraries/LibWeb/HTML/MessageEvent.h
+++ b/Userland/Libraries/LibWeb/HTML/MessageEvent.h
@@ -31,20 +31,20 @@ public:
virtual ~MessageEvent() override = default;
- JS::Value data() const { return m_data; }
+ JS::Value data() const { return m_data.value(); }
String const& origin() const { return m_origin; }
String const& last_event_id() const { return m_last_event_id; }
protected:
MessageEvent(FlyString const& event_name, MessageEventInit const& event_init)
: DOM::Event(event_name, event_init)
- , m_data(event_init.data)
+ , m_data(JS::make_handle(event_init.data))
, m_origin(event_init.origin)
, m_last_event_id(event_init.last_event_id)
{
}
- JS::Value m_data;
+ JS::Handle<JS::Value> m_data;
String m_origin;
String m_last_event_id;
};