1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 21:47:46 +00:00

LibWeb: Store PromiseRejectionEvent::m_reason in a JS::Handle

This commit is contained in:
Luke Wilde 2022-06-27 19:49:13 +01:00 committed by Linus Groh
parent 17a26853e1
commit 1d5b03ce17

View file

@ -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;
};
}