18:38
<akaster>

Is HostPromiseRejectionTracker supposed to be handling Promises, or PromiseCapabilties? https://tc39.es/ecma262/#sec-host-promise-rejection-tracker

HTML expects to use the passed-in promise argument to index sets of Promise, which in HTML is actually WebIDL's Promise, which is actually a PromiseCapability. https://html.spec.whatwg.org/multipage/webappapis.html#the-hostpromiserejectiontracker-implementation

HTML also wants to insert the promise into a PromiseRejectionEventInit, which holds a WebIDL Promise explicitly. Alternatively I suppose I could start my impl of HostPromiseRejectionTracker by creating "a Promise resolved with promise" and doge the entire disconnect...

18:43
<akaster>
wait maybe I'm supposed to do that Promise resolved with promise dance anyway per "converting a javascript value to an IDL promise type" https://webidl.spec.whatwg.org/#js-promise 🤔. 🦆
18:44
<nicolo-ribaudo>
HTML expects Promise objects too. It links to https://webidl.spec.whatwg.org/#idl-promise, which is not the webidl promise capability
18:46
<akaster>
wait what? but 3.2.23. Promise types — Promise<T> says "IDL promise type values are represented by JavaScript PromiseCapability records."
which links to your link there in 2.13.30 https://webidl.spec.whatwg.org/#dfn-promise-type
18:47
<akaster>
I'm interpreting that to mean that HTML doesn't ever want to see a PromiseCapabiltiy's [[Promise]] Slot, and only wants to traffic in PromiseCapabilities
18:48
<akaster>
... probably should have asked this in whatwg matrix pinging domenic come to think of it 😅
18:55
<Mathieu Hofman>
wait maybe I'm supposed to do that Promise resolved with promise dance anyway per "converting a javascript value to an IDL promise type" https://webidl.spec.whatwg.org/#js-promise 🤔. 🦆
I don't think so as that would handle the promise, and just create another rejected promise?
18:59
<akaster>
hmm. and that would be 'observable' as a stack overflow constantly creating new rejected promises and passing them to the HostPromiseRejectionTracker? 🤔
19:04
<Mathieu Hofman>
the point of the unhandled and handled rejection events is to be able to associate them to the promise that is unhandled and possibly later becomes handled
19:06
<Mathieu Hofman>
Arguably you could "map" them to another promise value, but you'd have to make that mapping stable, and I'd say you shouldn't handle the original promise in the first place
19:06
<Mathieu Hofman>
There's actually an open question in HTML of how to report unhandled promise events from other realms (ShadowRealm or Worker)
19:07
<akaster>
hmm. so in that case, https://html.spec.whatwg.org/multipage/webappapis.html#outstanding-rejected-promises-weak-set telling me that they are Promises, and linking to both https://webidl.spec.whatwg.org/#idl-promise and https://webidl.spec.whatwg.org/#js-promise is misleading
19:07
<akaster>
it should say that they are ... "promises", or something, and make it clear that these are not WebIDL Promises represented by a PromiseCapability, but the actual JS value of the promise...
19:08
<akaster>
man. sideshowbarker told me to be careful with WebIDL issues. I see what he means now, there's a bunch of ambiguity here
19:11
<Mathieu Hofman>
I can't speak to the HTML spec, just about the intent of these features
19:11
<akaster>
yeah, I'll probably open an HTML issue so domenic et al can comment at their liesure