- From: Kevin Gibbons <notifications@github.com>
- Date: Mon, 05 Jan 2026 16:45:03 -0800
- To: whatwg/webidl <webidl@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <whatwg/webidl/pull/1529/review/3628883140@github.com>
@bakkot commented on this pull request.
> - 1. Let |length| be 0.
- 1. If |jsBufferSource| has a \[[ViewedArrayBuffer]] [=/internal slot=], then:
- 1. Set |jsArrayBuffer| to |jsBufferSource|.\[[ViewedArrayBuffer]].
- 1. Set |offset| to |jsBufferSource|.\[[ByteOffset]].
- 1. Set |length| to |jsBufferSource|.\[[ByteLength]].
- 1. Otherwise:
- 1. Assert: |jsBufferSource| is an {{ArrayBuffer}} or
- {{SharedArrayBuffer}} object.
- 1. Set |length| to |jsBufferSource|.\[[ArrayBufferByteLength]].
+ 1. Let |length| be |bufferSource|'s [=BufferSource/byte length=].
+ 1. If |bufferSource| is a [=buffer view type=] instance:
+ 1. Set |arrayBuffer| to |bufferSource|'s [=underlying buffer=].
+ 1. Set |offset| to |bufferSource|'s [=ArrayBufferView/byte offset=].
+ 1. [=/Assert=]: |arrayBuffer| is an {{ArrayBuffer}} or {{SharedArrayBuffer}} object.
+ 1. Let |jsArrayBuffer| be the result of [=converted to a JavaScript value|converting=]
+ |arrayBuffer| to a JavaScript value.
1. If [$IsDetachedBuffer$](|jsArrayBuffer|) is true, then return the empty
If you pass a TA backed by a detached buffer, then the `Set |offset| to |bufferSource|'s [=ArrayBufferView/byte offset=].` step above will throw. It's weird that passing a TA backed by a detached buffer throws while passing the detached buffer itself returns the empty byte sequence (in this step). It doesn't fundamentally break anything, but it's inconsistent.
--
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/webidl/pull/1529#pullrequestreview-3628883140
You are receiving this because you are subscribed to this thread.
Message ID: <whatwg/webidl/pull/1529/review/3628883140@github.com>
Received on Tuesday, 6 January 2026 00:45:06 UTC