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

domenic commented on this pull request.

Some questions about the code/spec changes. Tests look great, including the comment block.

> @@ -505,16 +505,6 @@ class WritableStreamDefaultWriter {
       return Promise.reject(defaultWriterBrandCheckException('write'));
     }
 
-    const stream = this._ownerWritableStream;

I am sad about moving these checks as I like the separation of invariant-checking in the public API only. It seems like at least the first check, of stream being undefined, can stay here. What about the second one?

> @@ -747,6 +747,21 @@ function WritableStreamDefaultControllerClose(controller) {
   WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller);
 }
 
+function WritableStreamDefaultControllerGetChunkSize(controller, chunk) {

This appears to be called from only one place, so inlining it fits better with our style.

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

Received on Friday, 10 February 2017 20:15:31 UTC