Re: [whatwg/fetch] Editorial: Fix realmless ArrayBuffer creation (PR #1751)

> This looks correct, but I wonder if we have test coverage for this.

There are no tests for the realm of created objects at all, that I can find. I could add some but I'd be inventing the conventions.

> The longer term plan is to fix this more generally through Web IDL by making an ambient realm available to be used for creating (most) new objects.

Presumably that would apply to the first hunk (the one in `extract a body with type`), but not the second (the one in `arrayBuffer()`), right? Since the ambient realm is not the one used in the second case. (Specifically, if you do `await firstRealm.Response.prototype.arrayBuffer.call(new secondRealm.Response('asdf'))`, the resulting `ArrayBuffer` comes from the _second_ realm, not the first, i.e. it is derived from the realm of `this` rather than the realm of the `arrayBuffer` function.)

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

Message ID: <whatwg/fetch/pull/1751/c2096305813@github.com>

Received on Monday, 6 May 2024 15:30:41 UTC