Re: [whatwg/streams] add @@asyncIterator to ReadableStreamDefaultReader (#950)

OK, here are the big issues left, from what I can see:

- Move/alias the methods to ReadableStream, instead of putting them on the default reader.
  - Should we alias, or move? I guess alias is nice since it lets you manually consume a couple with a given reader, then switch to for-await-of?
  - See the pattern used for cancel() for how this would work. TLDR don't call public API methods, use abstract ops
- Handle the return-with-pending-reads case, by returning a rejected promise? This seems like it needs to be handled regardless of where we put the methods.
- Should the methods of ReadableStreamDefaultReaderAsyncIteratorPrototype call the public API of the wrapped reader, or should they use the corresponding abstract ops directly?
  - I lean toward using the ops directly. Why add the complication of letting patches to ReadableStreamReader mess with how stuff works?
  - Then we could get rid of the "if this was an abrupt completion" checks, since e.g. ReadableStreamDefaultReaderRead is nothrow.

-- 
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/950#issuecomment-417393457

Received on Thursday, 30 August 2018 17:04:06 UTC