Skip to content

Commit 25a013f

Browse files
authored
README: Add (and answer) question about immutableArrayBuffer.transfer() (#5)
1 parent 6ffe758 commit 25a013f

File tree

1 file changed

+35
-7
lines changed

1 file changed

+35
-7
lines changed

README.md

Lines changed: 35 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,38 @@ Tracking issues to be added:
6868

6969
## Q&A
7070

71-
* Should `transferToImmutable` support a `newByteLength` argument?
72-
* Should trying to write data in an immutable ArrayBuffer via a TypedArray element set throw, even though trying to write out-of-bounds or to a detached ArrayBuffer does not?
73-
* Should TypedArray write methods (`copyWithin`, `fill`, `reverse`, `set`, etc.) throw when their backing ArrayBuffer is immutable but the targeted range is zero-length? If so, how early or late in the algorithm? The methods currently inspect arguments after ValidateTypedArray.
74-
* Similarly,
75-
* How early or late in SetViewValue against an immutable ArrayBuffer should an exception be thrown? It currently inspects arguments *before* IsViewOutOfBounds.
76-
* Likewise for abstract operations such as ArrayBufferCopyAndDetach (which currently checks IsSharedArrayBuffer, then _newLength_, then IsDetachedBuffer).
77-
* And also for `Atomics` functions.
71+
<dl>
72+
<dt>
73+
74+
Why can't an immutable ArrayBuffer be detached/transferred?
75+
76+
</dt>
77+
<dd>
78+
79+
Because that would result in observable changes to any TypedArray or DataView backed by it.
80+
81+
</dd>
82+
<dt>
83+
84+
Should `transferToImmutable` support a `newByteLength` argument?
85+
86+
</dt>
87+
<dt>
88+
89+
Should trying to write data in an immutable ArrayBuffer via a TypedArray element set throw, even though trying to write out-of-bounds or to a detached ArrayBuffer does not?
90+
91+
</dt>
92+
<dt>
93+
94+
Should TypedArray write methods (`copyWithin`, `fill`, `reverse`, `set`, etc.) throw when their backing ArrayBuffer is immutable but the targeted range is zero-length? If so, how early or late in the algorithm? The methods currently inspect arguments after ValidateTypedArray.
95+
96+
</dt>
97+
<dt>
98+
99+
Similarly,
100+
* How early or late in SetViewValue against an immutable ArrayBuffer should an exception be thrown? It currently inspects arguments *before* IsViewOutOfBounds.
101+
* Likewise for abstract operations such as ArrayBufferCopyAndDetach (which currently checks IsSharedArrayBuffer, then _newLength_, then IsDetachedBuffer).
102+
* And also for `Atomics` functions.
103+
104+
</dt>
105+
<dl>

0 commit comments

Comments
 (0)