String#startsWith/endsWith/includes don't handle Infinity position/endPosition args...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 1 May 2015 22:44:30 +0000 (22:44 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 1 May 2015 22:44:30 +0000 (22:44 +0000)
commit2186c298b82555577e662edc91fa7b35afa672f2
tree68aafff1372e24f4c02496ad384fb5092bcbfea6
parentf3b5496ad7df95743a7323321c72e03b806c09fb
String#startsWith/endsWith/includes don't handle Infinity position/endPosition args correctly
https://bugs.webkit.org/show_bug.cgi?id=144314

Patch by Jordan Harband <ljharb@gmail.com> on 2015-05-01
Reviewed by Darin Adler.

Source/JavaScriptCore:

Fixing handling of Infinity position args, per
https://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype.includes
https://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype.startswith
https://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype.endswith

* runtime/StringPrototype.cpp:
(JSC::clampInt32):
(JSC::stringProtoFuncStartsWith):
(JSC::stringProtoFuncEndsWith):
(JSC::stringProtoFuncIncludes):

LayoutTests:

* js/script-tests/string-includes.js:
* js/string-includes-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@183694 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/js/script-tests/string-includes.js
LayoutTests/js/string-includes-expected.txt
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/runtime/StringPrototype.cpp