1 of 6

Limited ArrayBuffer proposal

What’s next

2 of 6

Timeline

Read-only Collections

Oct 2019, by MM & PHE, stage 1

Limited ArrayBuffer

Apr 2021, by JWK, stage 1

references

Resizable ArrayBuffer

Aug 2021, by SYG

Immutable ArrayBuffer

by MM & PHE & RGN & JWK

[stage 1] Nov 2024

[stage 2] Dec 2024

Similar API shape: transferToImmutable

ArrayBuffer.prototype.transfer

Oct 2022, by SYG & JH & Yagiz Nizipli

Jul 2024 to stage 4

Replaces one of the motivations

splitted out from resizable AB

3 of 6

Revisit: problems to be solved

  1. Cannot make an ArrayBuffer read-only.
  2. Cannot give others a read-only view to the ArrayBuffer and keep the read-write permission internally.
  3. Cannot give others a slice of the whole ArrayBuffer.

4 of 6

Revisit: drafted solution

  • ArrayBuffer.prototype.freeze()

In-place freeze

5 of 6

Motivation: what’s left

Limited ArrayBuffer

  • Freeze an ArrayBuffer in-place.
  • Limit write: Give others an RO view of the ArrayBuffer and keep the RW internally.

(Update: WebGPU may need this, see https://github.com/tc39/proposal-immutable-arraybuffer/issues/25)

  • Limit range: Give others an RO or RW slice of the whole ArrayBuffer without giving access to the whole buffer.

(WebAssembly use case: https://github.com/tc39/proposal-limited-arraybuffer/issues/11)

Immutable ArrayBuffer

  • ArrayBuffer.prototype.transferToImmutable

moved to

6 of 6

Stay in stage 1? Withdraw?

…?