Skip to content
This repository has been archived by the owner on Oct 24, 2023. It is now read-only.

Commit

Permalink
Normative: Fix detach check for TypedArray.prototype.transfer
Browse files Browse the repository at this point in the history
Closes #98
  • Loading branch information
syg committed Jul 11, 2022
1 parent 078e95a commit 3bb10f4
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -293,9 +293,12 @@ <h1>ArrayBuffer.prototype.transfer ( [ _newLength_ ] )</h1>
1. Let _O_ be the *this* value.
1. Perform ? RequireInternalSlot(_O_, [[ArrayBufferData]]).
1. If IsSharedArrayBuffer(_O_) is *true*, throw a *TypeError* exception.
1. If IsDetachedBuffer(_O_) is *true*, throw a *TypeError* exception.
1. If _newLength_ is *undefined*, let _newByteLength_ be _O_.[[ArrayBufferByteLength]].
1. Else, let _newByteLength_ be ? ToIntegerOrInfinity(_newLength_).
1. If _newLength_ is *undefined*, then
1. If IsDetachedBuffer(_O_) is *true*, throw a *TypeError* exception.
1. Let _newByteLength_ be _O_.[[ArrayBufferByteLength]].
1. Else,
1. Let _newByteLength_ be ? ToIntegerOrInfinity(_newLength_).
1. If IsDetachedBuffer(_O_) is *true*, throw a *TypeError* exception.
1. Let _new_ be ? Construct(%ArrayBuffer%, &laquo; 𝔽(_newByteLength_) &raquo;).
1. NOTE: This method returns a fixed-length ArrayBuffer.
1. Let _copyLength_ be min(_newByteLength_, _O_.[[ArrayBufferByteLength]]).
Expand Down

0 comments on commit 3bb10f4

Please sign in to comment.