Array.prototype.sort should also allow a null comparator
authorkeith_miller@apple.com <keith_miller@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 4 May 2017 02:16:12 +0000 (02:16 +0000)
committerkeith_miller@apple.com <keith_miller@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 4 May 2017 02:16:12 +0000 (02:16 +0000)
commit11f5a7903ef8d6daa78ddac9eea8eeccacfc2761
treef852a79912198b36c3a61e18e74af5f9e09c70ca
parent2a095f55e2609416795fd04bd618e90801aaa5a0
Array.prototype.sort should also allow a null comparator
https://bugs.webkit.org/show_bug.cgi?id=171621
JSTests:

Reviewed by Michael Saboff.

Add test to make it less likely we revert to the incompatable behavior.
Also, fix now incorrect tests.

* ChakraCore/test/Array/array_sort.baseline-jsc:
* stress/array-sort-bad-comparator.js:
(test):
* stress/sort-null-comparator.js: Added.
(assertEq):

Source/JavaScriptCore:

<rdar://problem/30757933>

Reviewed by Michael Saboff.

It looks like sort not accepting a null comparator
causes some pages to stop working. Those pages work in
Chrome/Firefox so we should try to match them.

* builtins/ArrayPrototype.js:
(sort):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216169 268f45cc-cd09-0410-ab3c-d52691b4dbfc
JSTests/ChakraCore/test/Array/array_sort.baseline-jsc
JSTests/ChangeLog
JSTests/stress/array-sort-bad-comparator.js
JSTests/stress/sort-null-comparator.js [new file with mode: 0644]
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/builtins/ArrayPrototype.js