String#split is buggy
authorbarraclough@apple.com <barraclough@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 20 Sep 2011 01:41:42 +0000 (01:41 +0000)
committerbarraclough@apple.com <barraclough@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 20 Sep 2011 01:41:42 +0000 (01:41 +0000)
commit83df0075a0ee5053ff8abc41de2cec531bfc42c5
treebaf20450dbb32ccf0c1fe00fd922bbfedc0a7628
parent1caf69d342b9c8e2597b96599d80b8206d201633
String#split is buggy
https://bugs.webkit.org/show_bug.cgi?id=68348

Reviewed by Sam Weinig.

Source/JavaScriptCore:

* runtime/StringPrototype.cpp:
(JSC::jsStringWithReuse):
    - added helper function to reuse original JSString value.
(JSC::stringProtoFuncSplit):
    - Rewritten from the spec.
* tests/mozilla/ecma/String/15.5.4.8-2.js:
(getTestCases):
    - This test is not ES5 compliant.

LayoutTests:

* fast/js/script-tests/string-split-conformance.js: Added.
* fast/js/string-split-conformance-expected.txt: Added.
* fast/js/string-split-conformance.html: Added.
    - Added new Layout test based on:
        http://stevenlevithan.com/demo/split.cfm
* sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/15.5.4.14_String.prototype.split/S15.5.4.14_A1_T6-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/15.5.4.14_String.prototype.split/S15.5.4.14_A1_T7-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/15.5.4.14_String.prototype.split/S15.5.4.14_A1_T8-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/15.5.4.14_String.prototype.split/S15.5.4.14_A1_T9-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/15.5.4.14_String.prototype.split/S15.5.4.14_A2_T7-expected.txt:
    - Check in failing results for these 5 tests; they are all wrong
      (see https://bugs.ecmascript.org/show_bug.cgi?id=61).

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@95504 268f45cc-cd09-0410-ab3c-d52691b4dbfc
12 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/js/script-tests/string-split-conformance.js [new file with mode: 0644]
LayoutTests/fast/js/string-split-conformance-expected.txt [new file with mode: 0644]
LayoutTests/fast/js/string-split-conformance.html [new file with mode: 0644]
LayoutTests/sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/15.5.4.14_String.prototype.split/S15.5.4.14_A1_T6-expected.txt
LayoutTests/sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/15.5.4.14_String.prototype.split/S15.5.4.14_A1_T7-expected.txt
LayoutTests/sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/15.5.4.14_String.prototype.split/S15.5.4.14_A1_T8-expected.txt
LayoutTests/sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/15.5.4.14_String.prototype.split/S15.5.4.14_A1_T9-expected.txt
LayoutTests/sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/15.5.4.14_String.prototype.split/S15.5.4.14_A2_T7-expected.txt
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/runtime/StringPrototype.cpp
Source/JavaScriptCore/tests/mozilla/ecma/String/15.5.4.8-2.js