indexOf and lastIndexOf shouldn't resolve ropes when needle is longer than haystack
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 28 Feb 2014 05:30:09 +0000 (05:30 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 28 Feb 2014 05:30:09 +0000 (05:30 +0000)
commita4cdc821cd1969996dc0c39609ceff8ca6fd913c
tree0fb857b093cea10f194d7f72a5bed600091f38c9
parent9e882a52cb2541049672972456d0a3ba8dc00e2d
indexOf and lastIndexOf shouldn't resolve ropes when needle is longer than haystack
https://bugs.webkit.org/show_bug.cgi?id=129466

Reviewed by Michael Saboff.

Refactored the code to avoid calling JSString::value when needle is longer than haystack.

* runtime/StringPrototype.cpp:
(JSC::stringProtoFuncIndexOf):
(JSC::stringProtoFuncLastIndexOf):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@164851 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/runtime/StringPrototype.cpp