Re: [whatwg/webidl] Record timing info for promise resolve/reject and callback (PR #1400)

> > That's not true, as firing an event clears the microtask queue (in "cleanup after script").
> 
> You're assuming the event is dispatched before the promise is resolved? I think I'd always want to resolve the promise first, but that's a good point and something to be careful about.

We actually had issues like this with view-transitions, and had to wrap the "resolve the promise" call with a prepare/cleanup to avoid this jumbling of execution order... (see https://html.spec.whatwg.org/multipage/browsing-the-web.html#reveal step 5).

In most cases today there is only one "resolve a promise" in a task, and in the other cases I'd really recommend to do the above... The cases where "resolve a promise" calls blend their microtasks with other things your task is doing create an order-of-operation confusion and those are the exact same places where this type of measurement would also be confusing. 

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/webidl/pull/1400#issuecomment-2228642169
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/webidl/pull/1400/c2228642169@github.com>

Received on Monday, 15 July 2024 14:29:20 UTC