- From: Mattias Buelens <notifications@github.com>
- Date: Fri, 09 Jun 2023 08:22:43 -0700
- To: whatwg/streams <streams@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <whatwg/streams/pull/1145/review/1472414655@github.com>
@MattiasBuelens commented on this pull request. > method steps are: 1. If |view|.\[[ByteLength]] is 0, return [=a promise rejected with=] a {{TypeError}} exception. 1. If |view|.\[[ViewedArrayBuffer]].\[[ArrayBufferByteLength]] is 0, return [=a promise rejected with=] a {{TypeError}} exception. 1. If ! [$IsDetachedBuffer$](|view|.\[[ViewedArrayBuffer]]) is true, return [=a promise rejected with=] a {{TypeError}} exception. + 1. Let |minimumFill| be undefined. + 1. If |options|["{{ReadableStreamBYOBReaderReadOptions/min}}"] was given, + 1. If |options|["{{ReadableStreamBYOBReaderReadOptions/min}}"] is 0, return [=a promise + rejected with=] a {{TypeError}} exception. + 1. If |view| has a \[[TypedArrayName]] internal slot, + 1. If |options|["{{ReadableStreamBYOBReaderReadOptions/min}}"] > |view|.\[[ArrayLength]], + return [=a promise rejected with=] a {{RangeError}} exception. + 1. Let |elementSize| be the element size specified in [=the typed array constructors table=] for + |view|.\[[TypedArrayName]]. + 1. Set |minimumFill| to |options|["{{ReadableStreamBYOBReaderReadOptions/min}}"] * + |elementSize|. + 1. Otherwise (i.e., it is a {{DataView}}), + 1. If |options|["{{ReadableStreamBYOBReaderReadOptions/min}}"] > |view|.\[[ByteLength]], + return [=a promise rejected with=] a {{RangeError}} exception. + 1. Set |minimumFill| to |options|["{{ReadableStreamBYOBReaderReadOptions/min}}"]. I think I can solve this better by having a default `min` value in `ReadableStreamBYOBReader.read()` [like you suggested](https://github.com/whatwg/streams/pull/1145#discussion_r1223093596). Then `ReadableStreamBYOBReaderRead` can have `minimumFill` as a *required* argument, and no longer needs this computation. 🙂 -- Reply to this email directly or view it on GitHub: https://github.com/whatwg/streams/pull/1145#discussion_r1224448724 You are receiving this because you are subscribed to this thread. Message ID: <whatwg/streams/pull/1145/review/1472414655@github.com>
Received on Friday, 9 June 2023 15:22:49 UTC