Skip to content

Commit

Permalink
Merge pull request #41 from gibson042/gh-1-slicetoimmutable-clamping
Browse files Browse the repository at this point in the history
Normative: Align ArrayBuffer sliceToImmutable length clamping with slice

as suggested by @waldemarhorwat. Thanks!
  • Loading branch information
erights authored Feb 19, 2025
2 parents 1dd81c7 + 9fe3f1f commit c5a96d3
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions spec.emu
Original file line number Diff line number Diff line change
Expand Up @@ -683,9 +683,7 @@ contributors: Mark S. Miller, Richard Gibson
1. Let _bounds_ be ? ResolveBounds(_len_, _start_, _end_).
1. Let _first_ be _bounds_.[[From]].
1. Let _final_ be _bounds_.[[To]].
1. Let _newLen_ be _final_ - _first_.
1. NOTE: This differs from <emu-xref href="#sec-arraybuffer.prototype.slice" title></emu-xref>, which instead clamps _newLen_ to be non-negative.
1. If _newLen_ &lt; 0, throw a *RangeError* exception.
1. Let _newLen_ be max(_final_ - _first_, 0).
1. NOTE: Side-effects of the above steps may have detached or resized _O_.
1. If IsDetachedBuffer(_O_) is *true*, throw a *TypeError* exception.
1. Let _fromBuf_ be _O_.[[ArrayBufferData]].
Expand Down

0 comments on commit c5a96d3

Please sign in to comment.