Right now indexOf and lastIndexOf always resolves ropes via JSString::toString. Just return -1 before resolving ropes when needle is longer than haystack.
<rdar://problem/16192706>
<rdar://problem/16192707>
Created attachment 225434 [details] Patch
Comment on attachment 225434 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=225434&action=review r=me > Source/JavaScriptCore/ChangeLog:8 > + Refactored the code to avoid calling toString on JSString when needle is longer than haystack. It is actually JSString::value that you are avoiding.
Thanks for the review. (In reply to comment #4) > (From update of attachment 225434 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=225434&action=review > > r=me > > > Source/JavaScriptCore/ChangeLog:8 > > + Refactored the code to avoid calling toString on JSString when needle is longer than haystack. > > It is actually JSString::value that you are avoiding. Oops, yes. Will fix before landing it.
Committed r164851: <http://trac.webkit.org/changeset/164851>