Skip to content

Commit 6e6452f

Browse files
authored
fixup! Editorial: Introduce ResolveBounds
1 parent 8e3eaea commit 6e6452f

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

spec.emu

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -525,8 +525,8 @@ contributors: Mark S. Miller, Richard Gibson
525525
1. Let _newBuffer_ be ? <emu-meta suppress-effects="user-code">AllocateArrayBuffer(%ArrayBuffer%, _newByteLength_, _newMaxByteLength_)</emu-meta>.
526526
1. <del>Let _copyLength_ be min(_newByteLength_, _arrayBuffer_.[[ArrayBufferByteLength]]).</del>
527527
1. Let _fromBlock_ be _arrayBuffer_.[[ArrayBufferData]].
528-
1. Let _toBlock_ be _newBuffer_.[[ArrayBufferData]].
529528
1. <ins>NOTE: This is the only step that can write into the Data Block of an immutable ArrayBuffer.</ins>
529+
1. Let _toBlock_ be _newBuffer_.[[ArrayBufferData]].
530530
1. Perform CopyDataBlockBytes(_toBlock_, 0, _fromBlock_, 0, _copyLength_).
531531
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`.
532532
1. Perform ! DetachArrayBuffer(_arrayBuffer_).
@@ -672,9 +672,17 @@ contributors: Mark S. Miller, Richard Gibson
672672
1. If IsSharedArrayBuffer(_O_) is *true*, throw a *TypeError* exception.
673673
1. If IsDetachedBuffer(_O_) is *true*, throw a *TypeError* exception.
674674
1. Let _len_ be _O_.[[ArrayBufferByteLength]].
675-
1. Let _bounds_ be ? ResolveBounds(_len_, _start_, _end_).
676-
1. Let _first_ be _bounds_.[[From]].
677-
1. Let _final_ be _bounds_.[[To]].
675+
1. <del>Let _relativeStart_ be ? ToIntegerOrInfinity(_start_).</del>
676+
1. <del>If _relativeStart_ = -∞, let _first_ be 0.</del>
677+
1. <del>Else if _relativeStart_ &lt; 0, let _first_ be max(_len_ + _relativeStart_, 0).</del>
678+
1. <del>Else, let _first_ be min(_relativeStart_, _len_).</del>
679+
1. <del>If _end_ is *undefined*, let _relativeEnd_ be _len_; else let _relativeEnd_ be ? ToIntegerOrInfinity(_end_).</del>
680+
1. <del>If _relativeEnd_ = -∞, let _final_ be 0.</del>
681+
1. <del>Else if _relativeEnd_ &lt; 0, let _final_ be max(_len_ + _relativeEnd_, 0).</del>
682+
1. <del>Else, let _final_ be min(_relativeEnd_, _len_).</del>
683+
1. <ins>Let _bounds_ be ? ResolveBounds(_len_, _start_, _end_).</ins>
684+
1. <ins>Let _first_ be _bounds_.[[From]].</ins>
685+
1. <ins>Let _final_ be _bounds_.[[To]].</ins>
678686
1. Let _newLen_ be max(_final_ - _first_, 0).
679687
1. Let _ctor_ be ? SpeciesConstructor(_O_, %ArrayBuffer%).
680688
1. Let _new_ be ? Construct(_ctor_, « 𝔽(_newLen_) »).

0 commit comments

Comments
 (0)