RESOLVED FIXED 209273
StringView::startsWith and String::startsWith do not treat null strings the same
https://bugs.webkit.org/show_bug.cgi?id=209273
Summary StringView::startsWith and String::startsWith do not treat null strings the same
youenn fablet
Reported 2020-03-19 00:53:03 PDT
String::startsWith(null) returns false. StringView::startsWith(null) returns true. Both startsWith(emptyString) returns true.
Attachments
Patch (3.65 KB, patch)
2020-03-19 07:13 PDT, youenn fablet
no flags
youenn fablet
Comment 1 2020-03-19 07:13:42 PDT
Darin Adler
Comment 2 2020-03-22 14:28:35 PDT
Comment on attachment 393975 [details] Patch I’m amazed. No one depended on the old behavior!?
youenn fablet
Comment 3 2020-03-23 02:28:05 PDT
(In reply to Darin Adler from comment #2) > Comment on attachment 393975 [details] > Patch > > I’m amazed. No one depended on the old behavior!? I was surprised too. Looking at our code base though, most of startsWith use null terminated strings as prefix so will not end up in that particular case.
EWS
Comment 4 2020-03-23 02:48:17 PDT
Committed r258828: <https://trac.webkit.org/changeset/258828> All reviewed patches have been landed. Closing bug and clearing flags on attachment 393975 [details].
Radar WebKit Bug Importer
Comment 5 2020-03-23 02:49:14 PDT
Note You need to log in before you can comment on or make changes to this bug.