You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There's still actually one problem with this one. For example if I have a refex /a/g and the path we are matching it against is aaa then the splats params should be ["a", "a", "a"].
Now the match function actually starts looping through captures from the second element so the first match is omitted.
for(varj=1,len=captures.length;j<len;++j){
So basically looping should start from the first element if the given regex is global.
Everything else would break if we just changed the looping start point.
One solution would do something like this
I understand what you mean, you would want to to have all the global captures starting from index 0.
This seems fine.
However that is a backwards compat change from the exec global semantics. So we should bump major version number. In fact i should have bumped major before instead of minor.
Let's add some more tests for this. I also really need to jump into the tests and use upgrade them to tape.
There's still actually one problem with this one. For example if I have a refex
/a/g
and the path we are matching it against isaaa
then the splats params should be["a", "a", "a"]
.Now the match function actually starts looping through captures from the second element so the first match is omitted.
So basically looping should start from the first element if the given regex is global.
Everything else would break if we just changed the looping start point.
One solution would do something like this
Any thoughts on this? I'd be happy to create a new pull request with couple of new tests included and version number changed to 1.2.1.
PS. It's nice to see that you are responding to pull requests almost immediately!
The text was updated successfully, but these errors were encountered: