[whatwg/streams] Callsites of TransferArrayBuffer don't all ensure the buffer isn't detached (#751)

`TransferArrayBuffer` asserts that the given buffer isn't detached, but its callsites don't ensure that this holds. In particular, [`ReadableByteStreamControllerEnqueue`](https://streams.spec.whatwg.org/#readable-byte-stream-controller-enqueue) passes in the chunk given to `enqueue` without checking if it's detached.

The best fix for this case might be to add
```
Step 6. If IsDetachedBuffer(chunk.[[ViewedArrayBuffer]]) is true, throw a TypeError exception.
```
to [`3.10.4.4. enqueue`](https://streams.spec.whatwg.org/#rbs-controller-enqueue).

I haven't fully verified the other callsites, but they might be ok because they deal with buffers that should have been verified earlier.

-- 
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/streams/issues/751

Received on Thursday, 20 July 2017 12:23:02 UTC