Re: [streams] Merge ReadableByteStream into ReadableStream (#430)

> -        } else {
> -          // The consumer is using the default reader.
> -          const buffer = new ArrayBuffer(DEFAULT_CHUNK_SIZE);
> -          return fs.read(fd, buffer, 0, DEFAULT_CHUNK_SIZE, position).then(bytesRead => {
> -            if (bytesRead === 0) {
> -              return fs.close(fd).then(() => controller.close());
> -            } else {
> -              position += bytesRead;
> -              controller.enqueue(new Uint8Array(buffer, 0, bytesRead));
> -            }
> -          });
> -        }
> +        // Even when the consumer is using the default reader, the auto allocate feature allocate a buffer and pass it
> +        // to us via byobRequest.
> +
> +        assert(controller.byobRequest !== undefined);

Let's remove this line; the comment is sufficient, and examples are easier to read if they're as brief as possible.

---
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/430/files/0562267ac9415713151bf0a34ae090c0dfb37c1a..4ad2edc8af0c82da98914eea6bd5c899618d8ec5#r57059054

Received on Tuesday, 22 March 2016 20:06:50 UTC