From 231f2709f4d888f13df2907e1b6b5cd5920e0ff3 Mon Sep 17 00:00:00 2001 From: Michael Dyck Date: Mon, 26 Sep 2022 21:24:10 -0700 Subject: [PATCH] Editorial: Define alias before reference (#2916) String.prototype.lastIndexOf must define _searchLen_ before using it. (fixup for PR #2848) --- spec.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec.html b/spec.html index 6ea0072aed..bda93e1f2b 100644 --- a/spec.html +++ b/spec.html @@ -33708,9 +33708,9 @@

String.prototype.lastIndexOf ( _searchString_ [ , _position_ ] )

1. Assert: If _position_ is *undefined*, then _numPos_ is *NaN*. 1. If _numPos_ is *NaN*, let _pos_ be +∞; otherwise, let _pos_ be ! ToIntegerOrInfinity(_numPos_). 1. Let _len_ be the length of _S_. + 1. Let _searchLen_ be the length of _searchStr_. 1. Let _start_ be the result of clamping _pos_ between 0 and _len_ - _searchLen_. 1. If _searchStr_ is the empty String, return 𝔽(_start_). - 1. Let _searchLen_ be the length of _searchStr_. 1. For each integer _i_ such that 0 ≤ _i_ ≤ _start_, in descending order, do 1. Let _candidate_ be the substring of _S_ from _i_ to _i_ + _searchLen_. 1. If _candidate_ is the same sequence of code units as _searchStr_, return 𝔽(_i_).