- From: Kevin Gibbons <notifications@github.com>
- Date: Wed, 09 Sep 2026 15:14:52 -0700
- To: whatwg/webidl <webidl@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <whatwg/webidl/pull/1529/review/5160445475@github.com>
@bakkot commented on this pull request.
> @@ -9312,26 +9312,65 @@ a reference to the same object that the IDL value represents.
To <dfn id="dfn-get-buffer-source-copy" export lt="get a copy of the buffer source|get a copy of the bytes held by the buffer source">get a copy of the bytes held by the buffer source</dfn>
given a [=buffer source type=] instance |bufferSource|:
- 1. Let |jsBufferSource| be the result of [=converted to a JavaScript value|converting=]
- |bufferSource| to a JavaScript value.
- 1. Let |jsArrayBuffer| be |jsBufferSource|.
+ 1. If |bufferSource| is [=BufferSource/detached=], then return the empty [=byte sequence=].
It's weird for this to treat detached and out of bounds differently - nothing in ecma262 does that. My preference would be to rectify this by replacing this "is detached" check to "is out of bounds", and have "is out of bounds" cover both detached and out of bounds ([like it does in ecma262](https://tc39.es/ecma262/multipage/ordinary-and-exotic-objects-behaviours.html#sec-istypedarrayoutofbounds)).
In fact probably the right thing is to replace _every_ detachedness check with an OOB check covering both possibilities.
--
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/webidl/pull/1529#pullrequestreview-5160445475
You are receiving this because you are subscribed to this thread.
Message ID: <whatwg/webidl/pull/1529/review/5160445475@github.com>
Received on Wednesday, 9 September 2026 22:14:56 UTC