Skip to content
New issue

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

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

Already on GitHub? # to your account

Fix regexp split with zero-length capture group #566

Merged
merged 1 commit into from
Sep 30, 2024

Conversation

bnoordhuis
Copy link
Contributor

The expected result of "ab".split(/(c)*/)[1] is undefined but was in fact "undefined" due to unintentional stringification.

Fixes: #565

The expected result of `"ab".split(/(c)*/)[1]` is `undefined` but
was in fact `"undefined"` due to unintentional stringification.

Fixes: quickjs-ng#565
@bnoordhuis bnoordhuis merged commit 1eb9608 into quickjs-ng:master Sep 30, 2024
52 checks passed
@bnoordhuis bnoordhuis deleted the fix565 branch September 30, 2024 23:05
@malbarbo
Copy link

malbarbo commented Oct 1, 2024

Thanks for the fast fix @bnoordhuis!

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

Successfully merging this pull request may close these issues.

'undefined' returned instead of undefined in string split with regex
3 participants