diff --git a/Userland/Libraries/LibWeb/HTML/PromiseRejectionEvent.cpp b/Userland/Libraries/LibWeb/HTML/PromiseRejectionEvent.cpp index 9329dbf0b31..17dd435ed98 100644 --- a/Userland/Libraries/LibWeb/HTML/PromiseRejectionEvent.cpp +++ b/Userland/Libraries/LibWeb/HTML/PromiseRejectionEvent.cpp @@ -24,7 +24,7 @@ WebIDL::ExceptionOr> PromiseRejectionEve PromiseRejectionEvent::PromiseRejectionEvent(JS::Realm& realm, FlyString const& event_name, PromiseRejectionEventInit const& event_init) : DOM::Event(realm, event_name, event_init) - , m_promise(const_cast(event_init.promise.cell())) + , m_promise(*event_init.promise) , m_reason(event_init.reason) { } diff --git a/Userland/Libraries/LibWeb/HTML/PromiseRejectionEvent.h b/Userland/Libraries/LibWeb/HTML/PromiseRejectionEvent.h index a4ca47aa1a1..b0c1ab856db 100644 --- a/Userland/Libraries/LibWeb/HTML/PromiseRejectionEvent.h +++ b/Userland/Libraries/LibWeb/HTML/PromiseRejectionEvent.h @@ -16,7 +16,7 @@ namespace Web::HTML { struct PromiseRejectionEventInit : public DOM::EventInit { - JS::Handle promise; + JS::Handle promise; JS::Value reason; }; @@ -31,7 +31,7 @@ public: virtual ~PromiseRejectionEvent() override; // Needs to return a pointer for the generated JS bindings to work. - JS::Promise const* promise() const { return m_promise; } + JS::Object const* promise() const { return m_promise; } JS::Value reason() const { return m_reason; } private: @@ -40,7 +40,7 @@ private: virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; - JS::GCPtr m_promise; + JS::NonnullGCPtr m_promise; JS::Value m_reason; }; diff --git a/Userland/Libraries/LibWeb/HTML/PromiseRejectionEvent.idl b/Userland/Libraries/LibWeb/HTML/PromiseRejectionEvent.idl index 01c2dce8087..a76a5074cbb 100644 --- a/Userland/Libraries/LibWeb/HTML/PromiseRejectionEvent.idl +++ b/Userland/Libraries/LibWeb/HTML/PromiseRejectionEvent.idl @@ -1,15 +1,15 @@ #import -// https://html.spec.whatwg.org/#promiserejectionevent -[Exposed=(Window,Worker)] +// https://html.spec.whatwg.org/multipage/webappapis.html#promiserejectionevent +[Exposed=*] interface PromiseRejectionEvent : Event { constructor(DOMString type, PromiseRejectionEventInit eventInitDict); - readonly attribute Promise promise; + readonly attribute object promise; readonly attribute any reason; }; dictionary PromiseRejectionEventInit : EventInit { - required Promise promise; + required object promise; any reason; };