Skip to content

Commit

Permalink
Add asserts to ReadableStreamDefaultController
Browse files Browse the repository at this point in the history
These asserts are in ReadableByteStreamController, so they should be here too.
  • Loading branch information
isonmad authored and domenic committed Sep 25, 2016
1 parent 3fd1246 commit 4be6fd1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions index.bs
Expand Up @@ -1446,6 +1446,8 @@ ReadableStreamDefaultController(<var>stream</var>, <var>underlyingSource</var>,
1. Resolve _startResult_ as a promise:
1. Upon fulfillment,
1. Set _controller_.[[started]] to *true*.
1. Assert: _controller_.[[pulling]] is *false*.
1. Assert: _controller_.[[pullAgain]] is *false*.
1. Perform ! ReadableStreamDefaultControllerCallPullIfNeeded(_controller_).
1. Upon rejection with reason _r_,
1. Perform ! ReadableStreamDefaultControllerErrorIfNeeded(_controller_, _r_).
Expand Down
4 changes: 4 additions & 0 deletions reference-implementation/lib/readable-stream.js
Expand Up @@ -976,6 +976,10 @@ class ReadableStreamDefaultController {
Promise.resolve(startResult).then(
() => {
controller._started = true;

assert(controller._pulling === false);
assert(controller._pullAgain === false);

ReadableStreamDefaultControllerCallPullIfNeeded(controller);
},
r => {
Expand Down

0 comments on commit 4be6fd1

Please sign in to comment.