diff --git a/spec.html b/spec.html index d8777efc460..c3767b4b7ce 100644 --- a/spec.html +++ b/spec.html @@ -42762,6 +42762,40 @@

+ +

+ ArrayBufferCopyAndDetach ( + _arrayBuffer_: an ECMAScript language value, + _newLength_: an ECMAScript language value, + _preserveResizability_: ~preserve-resizability~ or ~fixed-length~, + ): either a normal completion containing an ArrayBuffer or a throw completion +

+
+
+ + 1. Perform ? RequireInternalSlot(_arrayBuffer_, [[ArrayBufferData]]). + 1. If IsSharedArrayBuffer(_arrayBuffer_) is *true*, throw a *TypeError* exception. + 1. If _newLength_ is *undefined*, then + 1. Let _newByteLength_ be _arrayBuffer_.[[ArrayBufferByteLength]]. + 1. Else, + 1. Let _newByteLength_ be ? ToIndex(_newLength_). + 1. If IsDetachedBuffer(_arrayBuffer_) is *true*, throw a *TypeError* exception. + 1. If _preserveResizability_ is ~preserve-resizability~ and IsFixedLengthArrayBuffer(_arrayBuffer_) is *false*, then + 1. Let _newMaxByteLength_ be _arrayBuffer_.[[ArrayBufferMaxByteLength]]. + 1. Else, + 1. Let _newMaxByteLength_ be ~empty~. + 1. If _arrayBuffer_.[[ArrayBufferDetachKey]] is not *undefined*, throw a *TypeError* exception. + 1. Let _newBuffer_ be ? AllocateArrayBuffer(%ArrayBuffer%, _newByteLength_, _newMaxByteLength_). + 1. Let _copyLength_ be min(_newByteLength_, _arrayBuffer_.[[ArrayBufferByteLength]]). + 1. Let _fromBlock_ be _arrayBuffer_.[[ArrayBufferData]]. + 1. Let _toBlock_ be _newBuffer_.[[ArrayBufferData]]. + 1. Perform CopyDataBlockBytes(_toBlock_, 0, _fromBlock_, 0, _copyLength_). + 1. NOTE: Neither creation of the new Data Block nor copying from the old Data Block are observable. Implementations may implement this method as a zero-copy move or a `realloc`. + 1. Perform ! DetachArrayBuffer(_arrayBuffer_). + 1. Return _newBuffer_. + +
+

IsDetachedBuffer ( @@ -42784,6 +42818,8 @@

): either a normal completion containing ~unused~ or a throw completion

+
skip global checks
+
true
1. Assert: IsSharedArrayBuffer(_arrayBuffer_) is *false*. @@ -43206,6 +43242,17 @@

ArrayBuffer.prototype.constructor

The initial value of `ArrayBuffer.prototype.constructor` is %ArrayBuffer%.

+ +

get ArrayBuffer.prototype.detached

+

`ArrayBuffer.prototype.detached` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps when called:

+ + 1. Let _O_ be the *this* value. + 1. Perform ? RequireInternalSlot(_O_, [[ArrayBufferData]]). + 1. If IsSharedArrayBuffer(_O_) is *true*, throw a *TypeError* exception. + 1. Return IsDetachedBuffer(_O_). + +
+

get ArrayBuffer.prototype.maxByteLength

`ArrayBuffer.prototype.maxByteLength` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps when called:

@@ -43293,6 +43340,24 @@

ArrayBuffer.prototype.slice ( _start_, _end_ )

+ +

ArrayBuffer.prototype.transfer ( [ _newLength_ ] )

+

This method performs the following steps when called:

+ + 1. Let _O_ be the *this* value. + 1. Return ? ArrayBufferCopyAndDetach(_O_, _newLength_, ~preserve-resizability~). + +
+ + +

ArrayBuffer.prototype.transferToFixedLength ( [ _newLength_ ] )

+

This method performs the following steps when called:

+ + 1. Let _O_ be the *this* value. + 1. Return ? ArrayBufferCopyAndDetach(_O_, _newLength_, ~fixed-length~). + +
+

ArrayBuffer.prototype [ @@toStringTag ]

The initial value of the @@toStringTag property is the String value *"ArrayBuffer"*.