tc39 / tc39/proposal-immutable-arraybuffer
Order of operations, when to throw or silently do nothing?
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 38
- Forks
- 7
- PR merge metrics
- No merged PRs in 30d
Description
-
Should
sliceToImmutablewith reversed start and end throw an exception even thoughslicewith the same arguments would not? -
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.
Similarly,
-
How early or late in SetViewValue against an immutable ArrayBuffer should an exception be thrown? It currently inspects arguments before IsViewOutOfBounds.
-
Likewise for abstract operations such as ArrayBufferCopyAndDetach (which currently checks IsSharedArrayBuffer, then newLength, then IsDetachedBuffer).
-
And also for Atomics functions.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Review the listed operations—sliceToImmutable, TypedArray write methods, SetViewValue, ArrayBufferCopyAndDetach, and Atomics—and compare their current validation order. The issue is complete only after the proposal resolves when immutable-buffer errors should occur relative to argument, bounds, detachment, and zero-length checks.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- backend-api-design
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100