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

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Aug 29 03:40:03 PDT 2014


--- Comment #29 from Diego Pino <dpino at igalia.com>  2014-08-29 03:40:07 PST ---
(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), there's a contain, but only works for one char, that's why I stick with adding new functions to WTF::String. Maybe I didn't look in the right place. I agree with your reasoning, I don't like very much either the mandatory caseSensitive flag.

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