- From: Mattias Buelens <notifications@github.com>
- Date: Sun, 11 Jan 2026 07:10:07 -0800
- To: whatwg/webidl <webidl@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <whatwg/webidl/pull/1529/review/3647860597@github.com>
@MattiasBuelens 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
I changed it so we read both *byte length* and *byte offset* before we check if length is zero. That way, any exceptions from reading those properties will be thrown first.
--
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/webidl/pull/1529#discussion_r2679694333
You are receiving this because you are subscribed to this thread.
Message ID: <whatwg/webidl/pull/1529/review/3647860597@github.com>
Received on Sunday, 11 January 2026 15:10:10 UTC