From 1d0fe7c85c8f81a4ea301498ac036a8ef37a2a3d Mon Sep 17 00:00:00 2001 From: Mathias Bynens Date: Wed, 2 Oct 2019 17:42:55 +0200 Subject: [PATCH] Normative: make `String.prototype.matchAll` throw for non-global regular expressions (#1716) --- spec.html | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/spec.html b/spec.html index 0d23d656e7..f1d0ff74b5 100644 --- a/spec.html +++ b/spec.html @@ -29725,6 +29725,11 @@

String.prototype.matchAll ( _regexp_ )

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