← Back to release summary

ArrayBuffer.prototype.transfer

Category
JavaScript
Type
Chromium catches up
Status
Enabled by default (Chrome 114)
Intent stage
Prepare to ship

WPT details: In test262. -https://github.com/tc39/test262/tree/ff405fd0df81ff52c3bcb5b2be3e872983fb0402/test/built-ins/ArrayBuffer/prototype/transfer - https://github.com/tc39/test262/tree/ff405fd0df81ff52c3bcb5b2be3e872983fb0402/test/built-ins/ArrayBuffer/prototype/transferToFixedLength - https://github.com/tc39/test262/tree/ff405fd0df81ff52c3bcb5b2be3e872983fb0402/test/built-ins/ArrayBuffer/prototype/detached

Summary

Adds the ArrayBuffer.prototype.transfer method, which copies the receiver buffer, detaches the receiver, then returns the copy. This adds a JS API for what is possible via structured cloning. Also adds ArrayBuffer.prototype.transferToFixedLength and the ArrayBuffer.prototype.detached getter. This is a TC39 proposal.

Standards & signals

Ecosystem

Docs: https://github.com/tc39/proposal-arraybuffer-transfer

View on chromestatus.com