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)
commit2a13b6ab8693996f3138ad2eca67797e7e0b7f60
treef852a79912198b36c3a61e18e74af5f9e09c70ca
parentb1b20aa3cb1a932a3ee0bb853f80a742da2440e3
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: http://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