[Webkit-unassigned] [Bug 131704] Simple ES6 feature:String prototype additions

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Sep 12 17:56:35 PDT 2014


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


Darin Adler <darin at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #238045|review?                     |review+
               Flag|                            |




--- Comment #41 from Darin Adler <darin at apple.com>  2014-09-12 17:56:36 PST ---
(From update of attachment 238045)
View in context: https://bugs.webkit.org/attachment.cgi?id=238045&action=review

> Source/WTF/wtf/text/StringImpl.cpp:1424
> +bool StringImpl::startsWith(StringImpl& matchString, unsigned startOffset, bool caseSensitive) const
> +{
> +    return equalInner(const_cast<StringImpl&>(*this), startOffset, matchString, caseSensitive);
> +}

We should follow this up by removing all the const on StringImpl member functions since it’s an immutable class, and all StringImpl are const; when we remove the const from this one, we can remove the const_cast.

> Source/WTF/wtf/text/StringImpl.cpp:1455
> +bool StringImpl::endsWith(StringImpl& matchString, unsigned endOffset, bool caseSensitive) const
> +{
> +    if (endOffset < matchString.length())
> +        return false;
> +    return equalInner(const_cast<StringImpl&>(*this), endOffset - matchString.length(), matchString, caseSensitive);
> +}

We should follow this up by removing all the const on StringImpl member functions since it’s an immutable class, and all StringImpl are const; when we remove the const from this one, we can remove the const_cast.

-- 
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