Bug 44600 - REGRESSION: Splitting an empty string sometimes returns an empty array
Summary: REGRESSION: Splitting an empty string sometimes returns an empty array
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac (Intel) OS X 10.6
: P1 Normal
Assignee: Michael Saboff
URL:
Keywords: GoogleBug, InRadar, Regression
Depends on:
Blocks:
 
Reported: 2010-08-25 04:50 PDT by John Moe
Modified: 2010-08-25 20:10 PDT (History)
6 users (show)

See Also:


Attachments
Patch with new regression test for this issue. (2.50 KB, patch)
2010-08-25 14:58 PDT, Michael Saboff
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description John Moe 2010-08-25 04:50:16 PDT
In the console:
'a'.split(/\s+/)
["a"]
''.split(/\s+/)
[""]
''.split(/\s+/)
[]

Notice the last two are identical, but give different answers.  Other browsers and older webkit give the [""].  This seems to break some pages of Google apps for your domain admin.
Comment 1 Alexey Proskuryakov 2010-08-25 09:54:17 PDT
This is a regression from Safari 5.0.1.
Comment 2 Geoffrey Garen 2010-08-25 11:57:39 PDT
<rdar://problem/8354205>
Comment 3 Michael Saboff 2010-08-25 12:55:30 PDT
This bug is due to the single entry regexp cache.  That regexp cache has been removed in https://bugs.webkit.org/attachment.cgi?id=65336 as part of resolving https://bugs.webkit.org/show_bug.cgi?id=44555.

A test for this corner case will be added.
Comment 4 Michael Saboff 2010-08-25 14:58:35 PDT
Created attachment 65478 [details]
Patch with new regression test for this issue.

The underlying problem was fixed in bug https://bugs.webkit.org/show_bug.cgi?id=44555.
Comment 5 WebKit Commit Bot 2010-08-25 20:10:08 PDT
Comment on attachment 65478 [details]
Patch with new regression test for this issue.

Clearing flags on attachment: 65478

Committed r66075: <http://trac.webkit.org/changeset/66075>
Comment 6 WebKit Commit Bot 2010-08-25 20:10:14 PDT
All reviewed patches have been landed.  Closing bug.