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

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Aug 18 23:05:08 PDT 2014


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





--- Comment #12 from Diego Pino <dpino at igalia.com>  2014-08-18 23:05:13 PST ---
(In reply to comment #11)
> (From update of attachment 236762 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=236762&action=review
> 
> >> Source/JavaScriptCore/runtime/StringPrototype.cpp:1581
> >> +    for (uint32_t i = start, j = 0; j < searchLength; i++, j++) {
> > 
> > Why do this a character at a time instead of using WTF::String::startsWith? If WTF::String::startsWith is missing some features, we could add them.
> 
> The reason is that WTF::String::startsWith doesn't support a starting position, same as endsWith (doesn't support an endPosition) and contains (doesn't support a starting position). I can add new methods to WTF:String for supporting a second parameter indicating position for these methods and rely the implementation of String.prototype.startsWith on WTF:String::startsWith (same for endsWith and contains).

Forget about this comment, I can substring 'str' by 'pos' and use the methods of WTF::String. No need to add new methods to WTF::String.

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