[whatwg/fetch] can body consuming be interrupted by response/body GC? (#874)

Consider a case where we get a Response and start consuming its body in a function:

```
async function loadText(url) {
  let r = await fetch(url);
  return r.text();
}
```

This returns a promise without holding any explicit references to the response or its body.  If the body is particularly slow to load the response and body could be GC'd before it completes.

As a developer my expectation would be that the loading process would implicitly hold a strong reference to body.  Looking at the steps here, though:

https://fetch.spec.whatwg.org/#concept-body-consume-body

I don't see where such a reference is maintained.  I'm just trying to understand the intended behavior.

-- 
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/fetch/issues/874

Received on Friday, 22 February 2019 15:17:41 UTC