[Webkit-unassigned] [Bug 114240] Hopefully helpful comments for some String methods

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Apr 8 23:47:25 PDT 2013


https://bugs.webkit.org/show_bug.cgi?id=114240





--- Comment #2 from Geoffrey Garen <ggaren at apple.com>  2013-04-08 23:45:40 PST ---
(From update of attachment 197003)
View in context: https://bugs.webkit.org/attachment.cgi?id=197003&action=review

> Source/WTF/wtf/text/WTFString.h:194
> +    // Make sure the String is8Bit() before calling this.
>      const LChar* characters8() const
>      {
>          if (!m_impl)

Why doesn't the ASSERT convey this meaning? Is there a way to improve the ASSERT so that it conveys this meaning?

> Source/WTF/wtf/text/WTFString.h:200
> +    // Make sure the String !is8Bit() before calling this.

Same question.

> Source/WTF/wtf/text/WTFString.h:223
> +    // Unlike most String methods, this crashes if the String is null.
> +    // Use isNull() or isEmpty() to detect this special case.
> +    bool is8Bit() const
> +    {
> +        ASSERT(m_impl);
> +        return m_impl->is8Bit();
> +    }

I wonder if we should just fix this function instead of commenting around it.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list