Re: [whatwg/streams] add @@asyncIterator to ReadableStream (#954)

MattiasBuelens commented on this pull request.



> +    if (IsReadableStreamAsyncIterator(this) === false) {
+      return Promise.reject(streamAsyncIteratorBrandCheckException('next'));
+    }
+    const reader = this._asyncIteratorReader;
+    if (reader._ownerReadableStream === undefined) {
+      return Promise.reject(readerLockException('next'));
+    }
+    return ReadableStreamDefaultReaderRead(reader, true);
+  },
+
+  return(value) {
+    if (IsReadableStreamAsyncIterator(this) === false) {
+      return Promise.reject(streamAsyncIteratorBrandCheckException('next'));
+    }
+    const reader = this._asyncIteratorReader;
+    if (this.preventCancel === false) {

Good catch! This would have been an embarrassing bug. 😛 

-- 
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/954#discussion_r218343722

Received on Tuesday, 18 September 2018 08:39:34 UTC