Skip to content

Fix regexp split with zero-length capture group#566

Merged
bnoordhuis merged 1 commit intoquickjs-ng:masterfrom
bnoordhuis:fix565
Sep 30, 2024
Merged

Fix regexp split with zero-length capture group#566
bnoordhuis merged 1 commit intoquickjs-ng:masterfrom
bnoordhuis:fix565

Conversation

@bnoordhuis
Copy link
Copy Markdown
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
@bnoordhuis bnoordhuis deleted the fix565 branch September 30, 2024 23:05
@malbarbo
Copy link
Copy Markdown

malbarbo commented Oct 1, 2024

Thanks for the fast fix @bnoordhuis!

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.

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

3 participants