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

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Aug 29 09:18:20 PDT 2014


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





--- Comment #30 from Darin Adler <darin at apple.com>  2014-08-29 09:18:24 PST ---
(In reply to comment #29)
> (In reply to comment #26)
> 
> > Also, this overloading problem is a bad thing to introduce into the String class. We really don’t want to avoid it by simply having mysterious additional "true" arguments at every call site; it’s simply an ugly pattern. I think the direction we will want to go to clean this up is that instead of adding more functions to String, we will want to add and use StringView::contains/startsWith/endsWith and use StringView::substring to restrict the ranges of the searches. When we do that we will then get rid of these new overloads we just added. I suppose it’s OK to land them like this for now, but since I do see some difficulty here in writing those functions correctly without overflow problems we might want to just write the StringView ones instead.
> 
> I couldn't find similar functions in StringView (contains/startsWith/endsWith)

Correct. I said “add and use”, not “find and use”.

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