Skip to content

Commit

Permalink
Editorial: fix number types in Array.prototype.findIndex / RegExp.pro…
Browse files Browse the repository at this point in the history
…totype[Symbol.search]
  • Loading branch information
bakkot committed Nov 30, 2020
1 parent d5948f7 commit 3e5f76e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -32413,7 +32413,7 @@ <h1>RegExp.prototype [ @@search ] ( _string_ )</h1>
1. Let _currentLastIndex_ be ? Get(_rx_, *"lastIndex"*).
1. If SameValue(_currentLastIndex_, _previousLastIndex_) is *false*, then
1. Perform ? Set(_rx_, *"lastIndex"*, _previousLastIndex_, *true*).
1. If _result_ is *null*, return -1.
1. If _result_ is *null*, return *-1*<sub>𝔽</sub>.
1. Return ? Get(_result_, *"index"*).
</emu-alg>
<p>The value of the *"name"* property of this function is *"[Symbol.search]"*.</p>
Expand Down Expand Up @@ -33127,9 +33127,9 @@ <h1>Array.prototype.findIndex ( _predicate_ [ , _thisArg_ ] )</h1>
1. Let _Pk_ be ! ToString(𝔽(_k_)).
1. Let _kValue_ be ? Get(_O_, _Pk_).
1. Let _testResult_ be ! ToBoolean(? Call(_predicate_, _thisArg_, &laquo; _kValue_, 𝔽(_k_), _O_ &raquo;)).
1. If _testResult_ is *true*, return _k_.
1. If _testResult_ is *true*, return 𝔽(_k_).
1. Set _k_ to _k_ + 1.
1. Return -1.
1. Return *-1*<sub>𝔽</sub>.
</emu-alg>
<emu-note>
<p>The `findIndex` function is intentionally generic; it does not require that its *this* value be an Array object. Therefore it can be transferred to other kinds of objects for use as a method.</p>
Expand Down

0 comments on commit 3e5f76e

Please sign in to comment.