← Back to release summary

Immutable ArrayBuffers

Category
JavaScript
Type
Chromium catches up
Status
Proposed (Chrome Proposed)
Intent stage
None

WPT details: Covered by Test262

Summary

A TC39 proposal for immutable ArrayBuffers. This proposal adds to ArrayBuffer.prototype one read-only accessor: * `immutable: boolean` -- is this buffer immutable, or can its contents be changed? and two methods: * `transferToImmutable(newByteLength?: number) : ArrayBuffer` -- move the contents of the original buffer into a new immutable buffer, detach the original buffer, and return the new buffer. * `sliceToImmutable(start?: number, end?: number) : ArrayBuffer` -- create a new immutable buffer from a range of the original buffer's contents. An immutable buffer cannot be detached, resized, or further transferred.

Standards & signals

Ecosystem

Explainers: https://github.com/tc39/proposal-immutable-arraybuffer

View on chromestatus.com