fetch icon indicating copy to clipboard operation
fetch copied to clipboard

“Realmless” ArrayBuffer creation in Body’s arrayBuffer() steps

Open bathos opened this issue 1 year ago • 1 comments

The Body mixin’s arrayBuffer operation steps are defined as:

[returning] the result of running consume body with this and the following step given a byte sequence bytes: return a new ArrayBuffer whose contents are bytes.

The “new ArrayBuffer” portion is unlinked. It should presumably be linking to “create an ArrayBuffer” in Web IDL and its missing argument (a realm) should be supplied. I would expect the realm here to be the relevant realm of this.

(Issue discovered by @twiss when correcting ArrayBuffer usage in WebCrypto algorithms.)

bathos avatar Jun 21 '23 08:06 bathos

Might want to also fix

a Uint8Array wrapping an ArrayBuffer containing the available bytes

while here.

annevk avatar Jun 26 '23 08:06 annevk