Re: [whatwg/streams] Various fixes for readable byte streams (#1123)

@MattiasBuelens commented on this pull request.



> @@ -38,6 +39,13 @@ exports.implementation = class ReadableByteStreamControllerImpl {
       throw new TypeError(`The stream (in ${state} state) is not in the readable state and cannot be closed`);
     }
 
+    if (this._pendingPullIntos.length > 0) {

Good point, I'll move things around a bit. 👍

Currently, this also prevents valid usages like:
```javascript
const { done, value } = await transferAndFillViewSomehow(c.byobRequest.view);
if (done) {
  c.close(); // would throw when implemented as currently written
  c.byobRequest.respondWithNewView(value);
}
```
so the check *definitely* needs to move. 🙂

-- 
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/1123#discussion_r616018470

Received on Monday, 19 April 2021 16:55:48 UTC