- From: Domenic Denicola <notifications@github.com>
- Date: Mon, 19 Apr 2021 09:20:44 -0700
- To: whatwg/streams <streams@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Monday, 19 April 2021 16:20:57 UTC
@domenic commented on this pull request. > I think we will need to turn these checks into asserts inside RespondInternal(), and throw errors in Respond() and RespondWithNewView()? That does sound nicer. It's possible our original reasoning was that in error states like these, there are no guarantees, but we might as well make it better. > @@ -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) { Why locate these checks here, instead of e.g. in ReadableByteStreamControllerClose step 4? > 1. If |view|.\[[ViewedArrayBuffer]].\[[ArrayBufferByteLength]] is 0, throw a {{TypeError}} exception. Yeah, I guess so, although we'd want to update the tests to change the exception type expected. -- 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#pullrequestreview-639059919
Received on Monday, 19 April 2021 16:20:57 UTC