Bug 114907 - Fix some minor bad use of strings in WebCore
Summary: Fix some minor bad use of strings in WebCore
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Benjamin Poulain
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-20 19:13 PDT by Benjamin Poulain
Modified: 2013-04-21 22:53 PDT (History)
0 users

See Also:


Attachments
Patch (2.79 KB, patch)
2013-04-20 19:22 PDT, Benjamin Poulain
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Benjamin Poulain 2013-04-20 19:13:49 PDT
Fix some minor bad use of strings in WebCore
Comment 1 Benjamin Poulain 2013-04-20 19:22:00 PDT
Created attachment 198950 [details]
Patch
Comment 2 Darin Adler 2013-04-20 22:01:04 PDT
Comment on attachment 198950 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=198950&action=review

> Source/WebCore/ChangeLog:9
> +        (WebCore::Editor::selectedText): This was implictely getting the emptyString().

Typo or spelling error: should be "implicitly".

But also, I don’t understand what you mean. Do you mean that 0 was turning into the null string?
Comment 3 Benjamin Poulain 2013-04-21 00:03:58 PDT
> But also, I don’t understand what you mean. Do you mean that 0 was turning into the null string?

This
   replace(0, "")
Would turn into this (there is no replace for char*):
   replace((UChar)0, String(""))
And the constructor of String return the empty string if the length is 0 :(
Comment 4 Benjamin Poulain 2013-04-21 22:53:15 PDT
Committed r148854: <http://trac.webkit.org/changeset/148854>