Re: [whatwg/fetch] Editorial: Amend body reading to use no-promise version (PR #1569)

@annevk commented on this pull request.

Two thoughts:

1. I don't understand how "read all bytes" works as it doesn't seem to yield to the event loop.
2. If it somehow works I think we can rewrite "consume body" in a better way whereby it only uses a promise for the return value and not any internal logic.

>   <li><p>Let <var>reader</var> be the result of <a for=ReadableStream>getting a reader</a> for
- <var>body</var>'s <a for=body>stream</a>. If that threw an exception, then return
- <a>a promise rejected with</a> that exception.
+ <var>body</var>'s <a for=body>stream</a>. If that threw an exception, then run
+ <var>errorSteps</var> with that exception.

```suggestion
 <var>errorSteps</var> with that exception and return.
```
Right?

>   <var>processBodyError</var>, with <var>taskDestination</var>.
 
- <li><p><a for=promise>React</a> to <var>promise</var> with <var>fulfilledSteps</var> and
- <var>rejectedSteps</var>.
-</ol>
-</div>
-
-<div algorithm>
-<p>To <dfn export lt="fully reading body as promise">fully read body as promise</dfn>, given a

It seems nobody used this so this is safe: https://dontcallmedom.github.io/webdex/f.html#fully%20reading%20body%20as%20promise%40%40fetch%25%25dfn.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/pull/1569#pullrequestreview-1225913625
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/fetch/pull/1569/review/1225913625@github.com>

Received on Wednesday, 21 December 2022 11:31:19 UTC