Re: [whatwg/webidl] Give SharedArrayBuffer a dedicated type (PR #1311)

@bathos commented on this pull request.



> @@ -8646,30 +8696,33 @@ a reference to the same object that the IDL value represents.
 </div>
 
 <div algorithm>
-    The <dfn export for="BufferSource">byte length</dfn> of a {{BufferSource}} |bufferSource| is
-    the value returned by the following steps:
+    The <dfn id=buffersource-byte-length export for="buffer source type">byte length</dfn> of a
+    [=buffer source type=] |bufferSource| is the value returned by the following steps:
 
     1.  Let |esBufferSource| be the result of [=converted to an ECMAScript value|converting=]
         |bufferSource| to an ECMAScript value.
     1.  If |esBufferSource| has a \[[ViewedArrayBuffer]] internal slot, then return
         |esBufferSource|.\[[ByteLength]].

The `[[ViewedArrayBuffer]]` has `[[ArrayBufferByteLength]]`, not `[[ByteLength]]`. A view (whether TypedArray or DataView) has `[[ByteLength]]` (which may be smaller than `[[ViewedArrayBuffer]].[[ArrayBufferByteLength]]`). Isn’t what’s written already correct — isn’t the copy only of the byte range that the view represents?

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/webidl/pull/1311#discussion_r1211287526
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/webidl/pull/1311/review/1452508327@github.com>

Received on Wednesday, 31 May 2023 08:30:47 UTC