summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb
diff options
context:
space:
mode:
authorLuke Wilde <lukew@serenityos.org>2022-06-27 19:49:13 +0100
committerLinus Groh <mail@linusgroh.de>2022-06-29 21:21:50 +0100
commit1d5b03ce171df7a5a3aae3f4048ac3419e21fd74 (patch)
treef3854ddfac51415e94ed2b80dc3c202bacf7c300 /Userland/Libraries/LibWeb
parent17a26853e14b20c700aba187da5d56786f03a6a7 (diff)
downloadserenity-1d5b03ce171df7a5a3aae3f4048ac3419e21fd74.zip
LibWeb: Store PromiseRejectionEvent::m_reason in a JS::Handle
Diffstat (limited to 'Userland/Libraries/LibWeb')
-rw-r--r--Userland/Libraries/LibWeb/HTML/PromiseRejectionEvent.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/Userland/Libraries/LibWeb/HTML/PromiseRejectionEvent.h b/Userland/Libraries/LibWeb/HTML/PromiseRejectionEvent.h
index 944c8f1b8d..ecf676f2de 100644
--- a/Userland/Libraries/LibWeb/HTML/PromiseRejectionEvent.h
+++ b/Userland/Libraries/LibWeb/HTML/PromiseRejectionEvent.h
@@ -34,19 +34,18 @@ public:
// Needs to return a pointer for the generated JS bindings to work.
JS::Promise const* promise() const { return m_promise.cell(); }
- JS::Value reason() const { return m_reason; }
+ JS::Value reason() const { return m_reason.value(); }
protected:
PromiseRejectionEvent(FlyString const& event_name, PromiseRejectionEventInit const& event_init)
: DOM::Event(event_name, event_init)
, m_promise(event_init.promise)
- , m_reason(event_init.reason)
+ , m_reason(JS::make_handle(event_init.reason))
{
}
JS::Handle<JS::Promise> m_promise;
- // FIXME: Protect this from GC! Currently we have no handle for arbitrary JS::Value.
- JS::Value m_reason;
+ JS::Handle<JS::Value> m_reason;
};
}