Re: [whatwg/streams] ReadableStreamClose with async iterator and pending read requests errors (#1100)

I haven't done an analysis of this particular case, so there might indeed be a logic error in terms of what's intended. But I'll note that generally in promises, including in specs, resolving a promise that's already settled (e.g. already rejected) is a no-op:

```js
let resolve;
const p = new Promise((r, reject) => {
  reject(new Error());
  resolve = r;
});

resolve(); // does nothing
```

Again, maybe the extra resolve attempt indicates we're doing something wrong; we'll need a bit more time to do the analysis to figure out what the best behavior is. But at least one interpretation is that it should not cause an error, and just no-op. (If that's the case, then the action item is probably to add a note to the spec explaining that the resolve could be a no-op in that step.)

-- 
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/issues/1100#issuecomment-759072004

Received on Tuesday, 12 January 2021 22:16:48 UTC