Skip to content

Commit 9fe3f1f

Browse files
committed
Normative: Align ArrayBuffer sliceToImmutable length clamping with slice
Ref tc39#1 (comment)
1 parent 1dd81c7 commit 9fe3f1f

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

spec.emu

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -683,9 +683,7 @@ contributors: Mark S. Miller, Richard Gibson
683683
1. Let _bounds_ be ? ResolveBounds(_len_, _start_, _end_).
684684
1. Let _first_ be _bounds_.[[From]].
685685
1. Let _final_ be _bounds_.[[To]].
686-
1. Let _newLen_ be _final_ - _first_.
687-
1. NOTE: This differs from <emu-xref href="#sec-arraybuffer.prototype.slice" title></emu-xref>, which instead clamps _newLen_ to be non-negative.
688-
1. If _newLen_ &lt; 0, throw a *RangeError* exception.
686+
1. Let _newLen_ be max(_final_ - _first_, 0).
689687
1. NOTE: Side-effects of the above steps may have detached or resized _O_.
690688
1. If IsDetachedBuffer(_O_) is *true*, throw a *TypeError* exception.
691689
1. Let _fromBuf_ be _O_.[[ArrayBufferData]].

0 commit comments

Comments
 (0)