- From: Adam Rice <notifications@github.com>
- Date: Fri, 10 Feb 2017 04:57:40 -0800
- To: whatwg/streams <streams@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Friday, 10 February 2017 12:58:16 UTC
ricea commented on this pull request.
> @@ -654,7 +644,17 @@ function WritableStreamDefaultWriterRelease(writer) {
function WritableStreamDefaultWriterWrite(writer, chunk) {
const stream = writer._ownerWritableStream;
- assert(stream !== undefined);
+ if (stream === undefined) {
+ return Promise.reject(defaultWriterLockException('write to'));
+ }
+
+ const controller = stream._writableStreamController;
+
+ const chunkSize = WritableStreamDefaultControllerGetChunkSize(controller, chunk);
+
Drive-by comment: maybe we should check that `stream === writer._ownerWritableStream` before proceeding?
strategySize might have
1. Detached the writer
2. Created a new writer and done a bunch of writes with it
It's probably better just to eliminate the possibility rather than try to work out whether it would be a problem or not.
Needs test(s).
--
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/680#pullrequestreview-21240324
Received on Friday, 10 February 2017 12:58:16 UTC