From 9c072c057deaa4e492c4a141e77f63cb0b6254a1 Mon Sep 17 00:00:00 2001 From: Richard Gibson Date: Thu, 10 Oct 2024 15:54:31 -0400 Subject: [PATCH] README: Clean up Q&A --- README.md | 41 ++++++++++++++++++++++++++++------------- 1 file changed, 28 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index ca649b1..67040d7 100644 --- a/README.md +++ b/README.md @@ -111,41 +111,54 @@ Tracking issues to be added: ## Q&A
-
+ -Why can't an immutable ArrayBuffer be detached/transferred? +
+Why can't an immutable ArrayBuffer be detached/transferred?
- Because that would result in observable changes to any TypedArray or DataView backed by it. -
-
-Should `transferToImmutable` support a `newByteLength` argument? -
+Should the index properties of a TypedArray backed by an immutable ArrayBuffer be configurable and writable? +
+
+No, TypedArray index properties should continue to track the state of the underlying buffer without individual bookkeeping. +
-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? -
-Should the index properties of a TypedArray backed by an immutable ArrayBuffer be configurable and writable? - +Should `transferToImmutable` support a _newByteLength_ argument?
+It might be useful for truncation, but probably rarely for expansion because the output would have an all-zeroes suffix that could not be changed. +
-No, TypedArray index properties should continue to track the state of the underlying buffer without individual bookkeeping. +
+ +Should ArrayBuffers support zero-copy slices (e.g., `arrayBuffer.sliceToImmutable()`)? +
+
+https://github.com/tc39/proposal-immutable-arraybuffer/issues/9
+ +
+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? +
-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. +
+ +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.
+ +
Similarly, @@ -154,4 +167,6 @@ Similarly, * And also for `Atomics` functions.
+ +