Skip to content

Commit

Permalink
Normative: make String.prototype.matchAll throw for non-global regula…
Browse files Browse the repository at this point in the history
…r expressions
  • Loading branch information
mathiasbynens committed Oct 2, 2019
1 parent 5b01972 commit e93524c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -29691,6 +29691,11 @@ <h1>String.prototype.matchAll ( _regexp_ )</h1>
<emu-alg>
1. Let _O_ be ? RequireObjectCoercible(*this* value).
1. If _regexp_ is neither *undefined* nor *null*, then
1. Let _isRegExp_ be ? IsRegExp(_regexp_).
1. If _isRegExp_ is true, then
1. Let _flags_ be ? Get(_regexp_, *"flags"*).
1. Perform ? RequireObjectCoercible(_flags_).
1. If ? ToString(_flags_) does not contain *"g"*, throw a *TypeError* exception.
1. Let _matcher_ be ? GetMethod(_regexp_, @@matchAll).
1. If _matcher_ is not *undefined*, then
1. Return ? Call(_matcher_, _regexp_, &laquo; _O_ &raquo;).
Expand Down

0 comments on commit e93524c

Please sign in to comment.