df5b6c4e72839fe721b4e2b3e690521e6d7b683301e577a3064166541fa9e65f17796bec1ff0abc2c5a7914c76f184ed1e625fc8d692a529c4bd94280a069d 643 B

1234567891011121314151617181920212223
  1. 'use strict';
  2. var $export = require('./_export');
  3. var aFunction = require('./_a-function');
  4. var toObject = require('./_to-object');
  5. var fails = require('./_fails');
  6. var $sort = [].sort;
  7. var test = [1, 2, 3];
  8. $export($export.P + $export.F * (fails(function () {
  9. // IE8-
  10. test.sort(undefined);
  11. }) || !fails(function () {
  12. // V8 bug
  13. test.sort(null);
  14. // Old WebKit
  15. }) || !require('./_strict-method')($sort)), 'Array', {
  16. // 22.1.3.25 Array.prototype.sort(comparefn)
  17. sort: function sort(comparefn) {
  18. return comparefn === undefined
  19. ? $sort.call(toObject(this))
  20. : $sort.call(toObject(this), aFunction(comparefn));
  21. }
  22. });