Closed rbuckton closed 3 years ago
Preview is at https://tc39.es/proposal-regexp-match-indices/pr/42/index.html#sec-makeindicesarray, changes at steps 5-6 and 12.e (was 11.e).
Why would we want to fix this by prepending undefined
, rather than changing the access points to correctly zero-index?
Why would we want to fix this by prepending
undefined
, rather than changing the access points to correctly zero-index?
Mostly to align it with indices. I can change groupNames to be off by one from indices, but I feel its worth adding a note somewhere to indicate why we use i - 1 in that algorithm, since its not clear from the algorithm itself.
I've updated https://github.com/tc39/proposal-regexp-match-indices/pull/42#issuecomment-613118031 to reflect the new changes based on PR feedback.
@ljharb can you take another look at this, now that its up-to-date with the d
flag changes?
Ensures groupNames is indexed with an offset -1 relative to the indices List.
Fixes #39
/cc @targos