Re: [whatwg/streams] Settle reader.[[closedPromise]] before performing close/error steps of read requests (#1102)

> Although this change is not observable for web authors (since all operations on a reader or async iterator have at least one microtask delay), it may be observable for other specifications (see comment on #1100).

As you've found, it is observable, so please remove this sentence. 😄 


> There was also a small bug in the reference implementation of the WebIDL promise helpers. Calling resolvePromise or rejectPromise on a promise created with promiseResolvedWith or promiseRejectedWith would throw an error (such as "promiseSideTable.get(p).resolve is not a function"). If we attempt to resolve or reject a promise that is already resolved or rejected, we should do nothing instead.

I believe the intent was to try to ensure that a promise in the standard would never be resolved or rejected more than once. In practice, we've never managed to completely eliminate such errors, so all implementations have to guard against them anyway. 

On balance, I think it's still worth trying to avoid multiple resolves / rejects in the reference implementation and standard, since it helps us catch some kinds of bugs.

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

Received on Thursday, 4 February 2021 20:31:33 UTC