mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 07:27:45 +00:00
LibWeb: Store PromiseRejectionEvent::m_reason in a JS::Handle
This commit is contained in:
parent
17a26853e1
commit
1d5b03ce17
1 changed files with 3 additions and 4 deletions
|
@ -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;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue