From e5335b984b79508c7d644fb77a0bd407a4feaa45 Mon Sep 17 00:00:00 2001
From: Domenic Denicola
Date: Tue, 31 Oct 2023 17:14:48 +0900
Subject: [PATCH] Fix PromiseRejectionEvent's promise attribute
As discovered in https://github.com/whatwg/streams/issues/1298#issuecomment-1774668957, Promise is actually not an appropriate type for it.
---
source | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/source b/source
index 093339b50c2..b728736a4e4 100644
--- a/source
+++ b/source
@@ -105721,12 +105721,12 @@ dictionary ErrorEventInit : EventInit {
interface PromiseRejectionEvent : Event {
constructor(DOMString type, PromiseRejectionEventInit eventInitDict);
- readonly attribute Promise<any> promise;
+ readonly attribute object promise;
readonly attribute any reason;
};
dictionary PromiseRejectionEventInit : EventInit {
- required Promise<any> promise;
+ required object promise;
any reason;
};
@@ -105734,6 +105734,12 @@ dictionary PromiseRejectionEventInit : EventInitpromise attribute must return the value it
was initialized to. It represents the promise which this notification is about.
+ Because of how Web IDL conversion rules for Promise<T>
types always wrap the input into a new promise, the
+ promise
attribute is of type object
instead, which is more appropriate for representing an opaque
+ handle to the original promise object.
+
The reason
attribute must return the value it
was initialized to. It represents the rejection reason for the promise.