Skip to content

[immutable-arraybuffer] Atomics#4554

Open
gibson042 wants to merge 13 commits intotc39:mainfrom
gibson042:2025-07-immutable-arraybuffer-atomics
Open

[immutable-arraybuffer] Atomics#4554
gibson042 wants to merge 13 commits intotc39:mainfrom
gibson042:2025-07-immutable-arraybuffer-atomics

Conversation

@gibson042
Copy link
Copy Markdown
Member

Includes #4545
Ref #4509

Atomics

  • Atomics.{add,and,compareExchange,exchange,or,store,sub,xor}

    • throws a TypeError if typedArray is an immutable ArrayBuffer, before coercing index
  • Atomics.load

    • works as expected if typedArray is an immutable ArrayBuffer
  • Atomics.notify

    • works as expected if typedArray is an immutable ArrayBuffer, returning 0 when index is in range and coercing count is successful

@gibson042 gibson042 requested a review from a team as a code owner August 1, 2025 06:42
…e contents

With `sedi` being a portable `sed -i`, e.g. `sed -i '' "$@"` on BSD and
`sed -i "$@"` on Linux:
```sh
git grep -l 'testWith[A-Za-z]*TypedArrayConstructors[(]' \
    test/built-ins/TypedArray/prototype/{copyWithin,fill,reverse,set,sort} | \
  xargs sedi -E \
    '/testWith[A-Za-z]*TypedArrayConstructors[(]/,$s#^[}][)]#}, null, null, ["immutable"])#'

git grep -l 'testWith[A-Za-z]*TypedArrayConstructors[(]' \
    test/built-ins/TypedArray/prototype | \
  grep -E 'set-value-during-|predicate-call-changes-value|values-are-not-cached' | \
  xargs sedi -E \
    '/testWith[A-Za-z]*TypedArrayConstructors[(]/,$s#^[}][)]#}, null, null, ["immutable"])#'
```
@gibson042 gibson042 force-pushed the 2025-07-immutable-arraybuffer-atomics branch from 8e83a8d to 28a2175 Compare February 22, 2026 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants