LibWeb: Update PromiseRejectionEvent's promise field to be object

This change was made in the HTML spec to address a comment from the
Gecko team for the Streams API in
a20ca78975

It also opens the door for some more Promise related refactors.
This commit is contained in:
Andrew Kaster 2024-10-25 12:36:25 -06:00 committed by Andrew Kaster
commit 52c449293a
Notes: github-actions[bot] 2024-10-25 20:05:29 +00:00
3 changed files with 8 additions and 8 deletions

View file

@ -16,7 +16,7 @@
namespace Web::HTML {
struct PromiseRejectionEventInit : public DOM::EventInit {
JS::Handle<JS::Promise> promise;
JS::Handle<JS::Object> 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<JS::Promise> m_promise;
JS::NonnullGCPtr<JS::Object> m_promise;
JS::Value m_reason;
};