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

Inconsistent behaviour in String#split in iOS/Safari #293

Open
lebbe opened this issue Feb 12, 2015 · 2 comments
Open

Inconsistent behaviour in String#split in iOS/Safari #293

lebbe opened this issue Feb 12, 2015 · 2 comments
Assignees

Comments

@lebbe
Copy link

lebbe commented Feb 12, 2015

When I do the following:

"4".split(/(?=(?:...)*$)/)

all browsers returns ['4'] except for iOs and Safari on mac, which returns ['4', ''].

I do not know what is "correct" behaviour, but this is indeed an inconsistency between JS-engines.

@ljharb ljharb self-assigned this Feb 12, 2015
@ljharb
Copy link
Member

ljharb commented Feb 12, 2015

In my testing, '4'.match(/(?=(?:...)*$)/) returns [""] on Safari 7, and ["4", ""] on Safari 8, whereas Firefox, Opera, and Chrome return ['4'] for "4".split(/(?=(?:...)*$)/).

@ljharb ljharb changed the title Inconsistent behaviour in String.prototype.split in iOs Inconsistent behaviour in String#split in iOS/Safari Feb 12, 2015
@ljharb
Copy link
Member

ljharb commented Jun 21, 2015

Duplicate of #103

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

No branches or pull requests

2 participants