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

Add support for named groups #14

Merged
merged 10 commits into from
May 14, 2018

Conversation

nicolo-ribaudo
Copy link
Collaborator

@nicolo-ribaudo nicolo-ribaudo commented Jan 6, 2018

This still needs a new version of regjsparser to be released (I used yarn link locally).

Also, I have a question: what should these regexs be transformed to? /\k<name>/, /(?<name>)(?<name>)\k<name> I just had to read the spec 🙂

@nicolo-ribaudo
Copy link
Collaborator Author

I think that the failing tests are not related to this PR.

@codecov-io
Copy link

codecov-io commented May 12, 2018

Codecov Report

Merging #14 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master    #14   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           3      3           
  Lines         151    186   +35     
  Branches       46     56   +10     
=====================================
+ Hits          151    186   +35
Impacted Files Coverage Δ
rewrite-pattern.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 930e97a...aae9459. Read the comment docs.

Copy link
Owner

@mathiasbynens mathiasbynens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay in reviewing this. I’ve pushed some changes, and fixed the build errors on master. Could you please rebase and take a look at the indirect call? Thanks.

groups.names[name] = index;
if (groups.onNamedGroup) {
// Indirect call is needed to not leak 'groups'
(0, groups.onNamedGroup)(name, index);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh? This feels a little magical…

@nicolo-ribaudo
Copy link
Collaborator Author

Rebased

@mathiasbynens mathiasbynens merged commit be842a2 into mathiasbynens:master May 14, 2018
@mathiasbynens
Copy link
Owner

Thanks for your contribution, @nicolo-ribaudo!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants