Skip to content

Commit

Permalink
simplify per gibson042
Browse files Browse the repository at this point in the history
  • Loading branch information
bakkot committed Jun 7, 2022
1 parent 5022959 commit 61e7436
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -36265,6 +36265,7 @@ <h1>
1. Let _groups_ be *undefined*.
1. Let _hasGroups_ be *false*.
1. Perform ! CreateDataPropertyOrThrow(_A_, *"groups"*, _groups_).
1. Let _matchedGroupNames_ be a new empty List.
1. For each integer _i_ such that _i_ &ge; 1 and _i_ &le; _n_, in ascending order, do
1. Let _captureI_ be _i_<sup>th</sup> element of _r_'s _captures_ List.
1. If _captureI_ is *undefined*, then
Expand All @@ -36282,17 +36283,14 @@ <h1>
1. Perform ! CreateDataPropertyOrThrow(_A_, ! ToString(𝔽(_i_)), _capturedValue_).
1. If the _i_<sup>th</sup> capture of _R_ was defined with a |GroupName|, then
1. Let _s_ be the CapturingGroupName of that |GroupName|.
1. Let _isMatchedEarlier_ be *false*.
1. For each integer _j_ such that _j_ &ge; 1 and _j_ &lt; _i_, do
1. If the _j_<sup>th</sup> capture of _R_ was defined with a |GroupName|, then
1. Let _sj_ be the CapturingGroupName of that |GroupName|.
1. If SameValue(_sj_, _s_) is *true* and the _j_<sup>th</sup> element of _r_'s _captures_ List is not *undefined*, set _isMatchedEarlier_ to *true*.
1. If _isMatchedEarlier_ is *false*, then
1. If _matchedGroupNames_ contains _s_, then
1. Assert: _capturedValue_ is *undefined*.
1. Append *undefined* to _groupNames_.
1. Else,
1. If _capturedValue_ is not *undefined*, append _s_ to _matchedGroupNames_.
1. NOTE: If there are multiple groups named _s_, _groups_ may already have an _s_ property at this point. However, because _groups_ is an ordinary object whose properties are all writable data properties, the call to CreateDataPropertyOrThrow is nevertheless guaranteed to succeed.
1. Perform ! CreateDataPropertyOrThrow(_groups_, _s_, _capturedValue_).
1. Append _s_ to _groupNames_.
1. Else,
1. Append *undefined* to _groupNames_.
1. Else,
1. Append *undefined* to _groupNames_.
1. If _hasIndices_ is *true*, then
Expand Down

0 comments on commit 61e7436

Please sign in to comment.