Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix PromiseRejectionEvent's promise attribute #9897

Merged
merged 1 commit into from
Dec 12, 2023

Conversation

domenic
Copy link
Member

@domenic domenic commented Oct 31, 2023

As discovered in whatwg/streams#1298 (comment), Promise is actually not an appropriate type for it.


/webappapis.html ( diff )

As discovered in whatwg/streams#1298 (comment), Promise<T> is actually not an appropriate type for it.
@domenic domenic requested a review from annevk November 2, 2023 06:05
Copy link
Member

@domfarolino domfarolino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I came across this accidentally, but thought I'd take a look.

data-x="">Promise&lt;<var>T</var>></code> types always wrap the input into a new promise, the
<code data-x="dom-PromiseRejectionEvent-promise">promise</code> attribute is of type <code
data-x="idl-object">object</code> instead, which is more appropriate for representing an opaque
handle to the original promise object.</p>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if it is more appropriate to link to https://webidl.spec.whatwg.org/#idl-promise where you write "promise" or not, but I noticed you did do that for "object" in this same note. (Of course "promise" is more conversational than "object" anyways.)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think linking Promise<T> would be reasonable, but "promise" isn't connected enough to that definition.

I'll file another editorial issue for linking Promise<T> globally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants