You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1. If IsSharedArrayBuffer(_O_) is *true*, throw a *TypeError* exception.
708
+
1. TODO: Confirm inclusion of this redundant check.
709
+
1. If IsDetachedBuffer(_O_) is *true*, throw a *TypeError* exception.
710
+
1. Let _len_ be _O_.[[ArrayBufferByteLength]].
711
+
1. Let _bounds_ be ? ResolveBounds(_len_, _start_, _end_).
712
+
1. Let _first_ be _bounds_.[[From]].
713
+
1. Let _final_ be _bounds_.[[To]].
714
+
1. TODO: Confirm this strictness vs. the conventional `max(_final_ - _first_, 0)`.
715
+
1. Let _newLen_ be _final_ - _first_.
716
+
1. If _newLen_ < 0, throw a *RangeError* exception.
717
+
1. Let _copyLen_ be min(_newLen_, _len_).
718
+
1. NOTE: Side-effects of the above steps may have detached or resized _O_. This algorithm proceeds only when _O_ is not detached, even if _newLen_ is 0.
719
+
1. If IsDetachedBuffer(_O_) is *true*, throw a *TypeError* exception.
720
+
1. Let _newBuffer_ be ? AllocateImmutableArrayBuffer(%ArrayBuffer%, _newLen_, _O_.[[ArrayBufferData]], _first_, _copyLen_).
0 commit comments