Re: [whatwg/streams] ReadableStream.from(asyncIterable) (#1083)

@ricea commented on this pull request.



> +  let stream;
+  const iteratorRecord = GetIterator(asyncIterable, 'async');
+
+  const startAlgorithm = () => undefined;
+
+  function pullAlgorithm() {
+    let nextResult;
+    try {
+      nextResult = IteratorNext(iteratorRecord);
+    } catch (e) {
+      return promiseRejectedWith(e);
+    }
+    const nextPromise = promiseResolvedWith(nextResult);
+    return transformPromiseWith(nextPromise, iterResult => {
+      if (!typeIsObject(iterResult)) {
+        throw new TypeError();

Please give the exceptions a message to help us grep for them when debugging.

-- 
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/1083#pullrequestreview-636378081

Received on Thursday, 15 April 2021 07:57:34 UTC