Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support indices.groups when compiling named groups in regexps #15092

Merged
merged 1 commit into from Oct 31, 2022
Merged

Support indices.groups when compiling named groups in regexps #15092

merged 1 commit into from Oct 31, 2022

Commits on Oct 31, 2022

  1. Add support for indices.groups

    If a RegExp has the /d flag (hasIndices), match objects should have an
    extra property .indices with an array of the character indices that each
    subgroup matched. The indices array itself has a property .groups giving
    the matched character indices (or undefined) for each named capturing
    group.
    
    This doesn't do anything to enable support for the /d flag, the
    hasIndices property, or the returned indices object, if the environment
    does not support it, but it will populate .indices.groups in _wrapRegExp
    if .indices is present, so that the
    transform-named-capturing-groups-regex and
    proposal-duplicate-named-capturing-groups-regex plugins can take
    advantage of that support if it exists.
    ptomato committed Oct 31, 2022
    Copy the full SHA
    8e52b21 View commit details
    Browse the repository at this point in the history