Skip to content

Commit

Permalink
Editorial: Clamp size before using with "substring of" (#3400)
Browse files Browse the repository at this point in the history
Fixes #3261
  • Loading branch information
gibson042 authored and ljharb committed Aug 26, 2024
1 parent 6ece111 commit 815aa8a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -35229,7 +35229,9 @@ <h1>String.prototype.split ( _separator_, _limit_ )</h1>
1. Return CreateArrayFromList(« _S_ »).
1. Let _separatorLength_ be the length of _R_.
1. If _separatorLength_ = 0, then
1. Let _head_ be the substring of _S_ from 0 to _lim_.
1. Let _strLen_ be the length of _S_.
1. Let _outLen_ be the result of clamping _lim_ between 0 and _strLen_.
1. Let _head_ be the substring of _S_ from 0 to _outLen_.
1. Let _codeUnits_ be a List consisting of the sequence of code units that are the elements of _head_.
1. Return CreateArrayFromList(_codeUnits_).
1. If _S_ is the empty String, return CreateArrayFromList(« _S_ »).
Expand Down

0 comments on commit 815aa8a

Please sign in to comment.