Skip to content

Commit

Permalink
Editorial: Simplify RegExpInitialize (tc39#2391)
Browse files Browse the repository at this point in the history
After the merge of tc39#2531, `_patternCharacters_` is no longer
used/referenced, so remove the steps that define it.

Also, add a NOTE after step 13.
  • Loading branch information
jmdyck authored and ljharb committed Jan 13, 2022
1 parent 497f99a commit 9f94ea5
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -35820,15 +35820,14 @@ <h1>
1. If _F_ contains *"u"*, let _u_ be *true*; else let _u_ be *false*.
1. If _u_ is *true*, then
1. Let _patternText_ be ! StringToCodePoints(_P_).
1. Let _patternCharacters_ be a List whose elements are the code points of _patternText_.
1. Else,
1. Let _patternText_ be the result of interpreting each of _P_'s 16-bit elements as a Unicode BMP code point. UTF-16 decoding is not applied to the elements.
1. Let _patternCharacters_ be a List whose elements are the code unit elements of _P_.
1. Let _parseResult_ be ParsePattern(_patternText_, _u_).
1. If _parseResult_ is a non-empty List of *SyntaxError* objects, throw a *SyntaxError* exception.
1. Assert: _parseResult_ is a |Pattern| Parse Node.
1. Set _obj_.[[OriginalSource]] to _P_.
1. Set _obj_.[[OriginalFlags]] to _F_.
1. NOTE: The definitions of _DotAll_, _IgnoreCase_, _Multiline_, and _Unicode_ in <emu-xref href="#sec-notation"></emu-xref> refer to this value of _obj_.[[OriginalFlags]].
1. Set _obj_.[[RegExpMatcher]] to CompilePattern of _parseResult_.
1. Perform ? Set(_obj_, *"lastIndex"*, *+0*<sub>𝔽</sub>, *true*).
1. Return _obj_.
Expand Down

0 comments on commit 9f94ea5

Please sign in to comment.