Skip to content

Conversation

@andrew-coleman
Copy link
Member

When partially applying the $match function, the regex was compiled and stored in the closure.
The same RegExp object was then applied multiple times in the $map, but the lastIndex property was not being reset, so alternate matches would fail (which then resets lastIndex to 0).

This PR fixes that.

resolves #427

Signed-off-by: andrew-coleman andrew_coleman@uk.ibm.com

Signed-off-by: andrew-coleman <andrew_coleman@uk.ibm.com>
@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 7188a61 on regex_index into daaa03e on master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 7188a61 on regex_index into daaa03e on master.

@mattbaileyuk mattbaileyuk merged commit 17c65e3 into master Mar 20, 2020
@mattbaileyuk mattbaileyuk deleted the regex_index branch March 20, 2020 16:21
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.

$map skipping every other element

4 participants