Re: [whatwg/streams] Execute strategySize first in write() (#680)

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);
+

I added tests to my wpt change and added the extra check here.

-- 
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

Received on Monday, 13 February 2017 10:05:01 UTC