@@ -36555,12 +36555,11 @@ <h1>RegExp.prototype [ @@match ] ( _string_ )</h1>
36555
36555
1. Let _rx_ be the *this* value.
36556
36556
1. If Type(_rx_) is not Object, throw a *TypeError* exception.
36557
36557
1. Let _S_ be ? ToString(_string_).
36558
- 1. Let _global_ be ToBoolean (? Get(_rx_, *"global "*)).
36559
- 1. If _global_ is *false *, then
36558
+ 1. Let _flags_ be ? ToString (? Get(_rx_, *"flags "*)).
36559
+ 1. If _flags_ does not contain *"g" *, then
36560
36560
1. Return ? RegExpExec(_rx_, _S_).
36561
36561
1. Else,
36562
- 1. Assert: _global_ is *true*.
36563
- 1. Let _fullUnicode_ be ToBoolean(? Get(_rx_, *"unicode"*)).
36562
+ 1. If _flags_ contains *"u"*, let _fullUnicode_ be *true*. Otherwise, let _fullUnicode_ be *false*.
36564
36563
1. Perform ? Set(_rx_, *"lastIndex"*, *+0*<sub>𝔽</sub>, *true*).
36565
36564
1. Let _A_ be ! ArrayCreate(0).
36566
36565
1. Let _n_ be 0.
@@ -36626,9 +36625,10 @@ <h1>RegExp.prototype [ @@replace ] ( _string_, _replaceValue_ )</h1>
36626
36625
1. Let _functionalReplace_ be IsCallable(_replaceValue_).
36627
36626
1. If _functionalReplace_ is *false*, then
36628
36627
1. Set _replaceValue_ to ? ToString(_replaceValue_).
36629
- 1. Let _global_ be ToBoolean(? Get(_rx_, *"global"*)).
36628
+ 1. Let _flags_ be ? ToString(? Get(_rx_, *"flags"*)).
36629
+ 1. If _flags_ contains *"g"*, let _global_ be *true*. Otherwise, let _global_ be *false*.
36630
36630
1. If _global_ is *true*, then
36631
- 1. Let _fullUnicode_ be ToBoolean(? Get(_rx_, *"unicode"*)) .
36631
+ 1. If _flags_ contains *"u"*, let _fullUnicode_ be *true*. Otherwise, let _fullUnicode_ be *false* .
36632
36632
1. Perform ? Set(_rx_, *"lastIndex"*, *+0*<sub>𝔽</sub>, *true*).
36633
36633
1. Let _results_ be a new empty List.
36634
36634
1. Let _done_ be *false*.
0 commit comments