diff --git a/lodash.src.js b/lodash.src.js index c7ed50d61..6befd3fd8 100644 --- a/lodash.src.js +++ b/lodash.src.js @@ -6541,7 +6541,7 @@ */ function sortByAll(collection) { var args = arguments; - if (args.length == 4 && isIterateeCall(args[1], args[2], args[3])) { + if (args.length > 3 && isIterateeCall(args[1], args[2], args[3])) { args = [collection, args[1]]; } var index = -1, diff --git a/test/test.js b/test/test.js index b5e57e55d..7084c5b8a 100644 --- a/test/test.js +++ b/test/test.js @@ -11809,8 +11809,14 @@ { 'a': 'y', '0': 2 } ]; - var actual = _.reduce([['a']], _.sortByAll, objects); - deepEqual(actual, [objects[0], objects[2], objects[1], objects[3]]); + var funcs = [_.sortByAll, _.partialRight(_.sortByAll, 'bogus')], + expected = _.map(funcs, _.constant([objects[0], objects[2], objects[1], objects[3]])); + + var actual = _.map(funcs, function(func) { + return _.reduce([['a']], func, objects); + }); + + deepEqual(actual, expected); }); }());