- From: Domenic Denicola <notifications@github.com>
- Date: Thu, 24 Jun 2021 15:10:48 -0700
- To: heycam/webidl <webidl@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Thursday, 24 June 2021 22:11:10 UTC
@domenic commented on this pull request.
> - 1. If <a abstract-op>IsDetachedBuffer</a>(|arrayBuffer|) is <emu-val>true</emu-val>, then
- return the empty byte sequence.
- 1. Let |data| be the value of |O|’s \[[ArrayBufferData]] [=internal slot=].
- 1. Return a reference to or copy of (as required) the |length| bytes in |data|
- starting at byte offset |offset|.
+<hr>
+
+<div algorithm>
+ To <dfn export for="ArrayBuffer">create</dfn> an {{ArrayBuffer}} from a [=byte sequence=]
+ |bytes| in a [=Realm=] |realm|:
+
+ 1. Let |arrayBuffer| be [=?=]
+ [$AllocateArrayBuffer$](|realm|.\[[Intrinsics]].[[{{%ArrayBuffer%}}]], |bytes|'s
+ [=byte sequence/length=]).
+ 1. [=ArrayBuffer/Write=] |bytes| into |arrayBuffer|.
+ 1. Return |arrayBuffer|.
I often conflate the two in other specs, but I guess in this particular spec we want to be clear.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/heycam/webidl/pull/987#discussion_r658315916
Received on Thursday, 24 June 2021 22:11:10 UTC