From 815aa8a4d68ce24bec81ba6789c37d55bc87b54a Mon Sep 17 00:00:00 2001 From: Richard Gibson Date: Mon, 26 Aug 2024 11:16:08 -0700 Subject: [PATCH] Editorial: Clamp size before using with "substring of" (#3400) Fixes #3261 --- spec.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spec.html b/spec.html index be1ef40f72..8493c6364b 100644 --- a/spec.html +++ b/spec.html @@ -35229,7 +35229,9 @@

String.prototype.split ( _separator_, _limit_ )

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_ »).