- From: Domenic Denicola <notifications@github.com>
- Date: Fri, 04 Nov 2016 13:52:08 -0700
- To: whatwg/fetch <fetch@noreply.github.com>
- Message-ID: <whatwg/fetch/issues/411@github.com>
Spinning off from the discussion in https://github.com/whatwg/fetch/pull/388#issuecomment-248290780. /cc @yutakahirano
I am not actually sure this is a problem. Note that JS objects can outlive their realm, e.g.
```html
<!DOCTYPE html>
<iframe srcdoc="<script>window.hello = {};</script>"></iframe>
<script>
const hello = frames[0].hello;
frames[0].location.href = "http://example.com/":
// `hello` is still a valid object
</script>
```
So is there any issue with this also being the case for streams that act as bodies?
One might think there is a problem with the object creation done by various stream operations. But no, that works fine too. Extend the above:
```js
const ObjectFromDeadFrame = hello.constructor;
const anotherObjectCreatedInDeadRealm = new ObjectFromDeadFrame();
```
I guess it might be accurate to say the realm isn't destroyed as long as someone holds a reference to it. You could still collect various things, e.g. the `Document` object and so on. But all the stuff streams needs to function is still there.
--
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/411
Received on Friday, 4 November 2016 20:52:44 UTC