Skip to content

Commit 5942961

Browse files
committed
Normative: Don't call @@method for RegExp on primitive values
1 parent e356adc commit 5942961

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

spec.html

+6-6
Original file line numberDiff line numberDiff line change
@@ -34067,7 +34067,7 @@ <h1>String.prototype.match ( _regexp_ )</h1>
3406734067
<p>This method performs the following steps when called:</p>
3406834068
<emu-alg>
3406934069
1. Let _O_ be ? RequireObjectCoercible(*this* value).
34070-
1. If _regexp_ is neither *undefined* nor *null*, then
34070+
1. If _regexp_ is an Object, then
3407134071
1. Let _matcher_ be ? GetMethod(_regexp_, @@match).
3407234072
1. If _matcher_ is not *undefined*, then
3407334073
1. Return ? Call(_matcher_, _regexp_, « _O_ »).
@@ -34087,7 +34087,7 @@ <h1>String.prototype.matchAll ( _regexp_ )</h1>
3408734087

3408834088
<emu-alg>
3408934089
1. Let _O_ be ? RequireObjectCoercible(*this* value).
34090-
1. If _regexp_ is neither *undefined* nor *null*, then
34090+
1. If _regexp_ is an Object, then
3409134091
1. Let _isRegExp_ be ? IsRegExp(_regexp_).
3409234092
1. If _isRegExp_ is *true*, then
3409334093
1. Let _flags_ be ? Get(_regexp_, *"flags"*).
@@ -34210,7 +34210,7 @@ <h1>String.prototype.replace ( _searchValue_, _replaceValue_ )</h1>
3421034210
<p>This method performs the following steps when called:</p>
3421134211
<emu-alg>
3421234212
1. Let _O_ be ? RequireObjectCoercible(*this* value).
34213-
1. If _searchValue_ is neither *undefined* nor *null*, then
34213+
1. If _searchValue_ is an Object, then
3421434214
1. Let _replacer_ be ? GetMethod(_searchValue_, @@replace).
3421534215
1. If _replacer_ is not *undefined*, then
3421634216
1. Return ? Call(_replacer_, _searchValue_, « _O_, _replaceValue_ »).
@@ -34318,7 +34318,7 @@ <h1>String.prototype.replaceAll ( _searchValue_, _replaceValue_ )</h1>
3431834318
<p>This method performs the following steps when called:</p>
3431934319
<emu-alg>
3432034320
1. Let _O_ be ? RequireObjectCoercible(*this* value).
34321-
1. If _searchValue_ is neither *undefined* nor *null*, then
34321+
1. If _searchValue_ is an Object, then
3432234322
1. Let _isRegExp_ be ? IsRegExp(_searchValue_).
3432334323
1. If _isRegExp_ is *true*, then
3432434324
1. Let _flags_ be ? Get(_searchValue_, *"flags"*).
@@ -34362,7 +34362,7 @@ <h1>String.prototype.search ( _regexp_ )</h1>
3436234362
<p>This method performs the following steps when called:</p>
3436334363
<emu-alg>
3436434364
1. Let _O_ be ? RequireObjectCoercible(*this* value).
34365-
1. If _regexp_ is neither *undefined* nor *null*, then
34365+
1. If _regexp_ is an Object, then
3436634366
1. Let _searcher_ be ? GetMethod(_regexp_, @@search).
3436734367
1. If _searcher_ is not *undefined*, then
3436834368
1. Return ? Call(_searcher_, _regexp_, « _O_ »).
@@ -34405,7 +34405,7 @@ <h1>String.prototype.split ( _separator_, _limit_ )</h1>
3440534405
<p>It performs the following steps when called:</p>
3440634406
<emu-alg>
3440734407
1. Let _O_ be ? RequireObjectCoercible(*this* value).
34408-
1. If _separator_ is neither *undefined* nor *null*, then
34408+
1. If _separator_ is an Object, then
3440934409
1. Let _splitter_ be ? GetMethod(_separator_, @@split).
3441034410
1. If _splitter_ is not *undefined*, then
3441134411
1. Return ? Call(_splitter_, _separator_, « _O_, _limit_ »).

0 commit comments

Comments
 (0)