Ensure fp.mergeAllWith accepts more than 2 sources. [closes #2786]

This commit is contained in:
John-David Dalton
2016-11-04 01:10:54 -07:00
parent fbb67f9dbe
commit 1b3815928d
3 changed files with 9 additions and 8 deletions

View File

@@ -172,9 +172,9 @@ exports.iterateeRearg = {
/** Used to map method names to rearg configs. */ /** Used to map method names to rearg configs. */
exports.methodRearg = { exports.methodRearg = {
'assignInAllWith': [1, 2, 0], 'assignInAllWith': [1, 0],
'assignInWith': [1, 2, 0], 'assignInWith': [1, 2, 0],
'assignAllWith': [1, 2, 0], 'assignAllWith': [1, 0],
'assignWith': [1, 2, 0], 'assignWith': [1, 2, 0],
'differenceBy': [1, 2, 0], 'differenceBy': [1, 2, 0],
'differenceWith': [1, 2, 0], 'differenceWith': [1, 2, 0],
@@ -183,7 +183,7 @@ exports.methodRearg = {
'intersectionWith': [1, 2, 0], 'intersectionWith': [1, 2, 0],
'isEqualWith': [1, 2, 0], 'isEqualWith': [1, 2, 0],
'isMatchWith': [2, 1, 0], 'isMatchWith': [2, 1, 0],
'mergeAllWith': [1, 2, 0], 'mergeAllWith': [1, 0],
'mergeWith': [1, 2, 0], 'mergeWith': [1, 2, 0],
'padChars': [2, 1, 0], 'padChars': [2, 1, 0],
'padCharsEnd': [2, 1, 0], 'padCharsEnd': [2, 1, 0],
@@ -206,15 +206,15 @@ exports.methodRearg = {
/** Used to map method names to spread configs. */ /** Used to map method names to spread configs. */
exports.methodSpread = { exports.methodSpread = {
'assignAll': { 'start': 0 }, 'assignAll': { 'start': 0 },
'assignAllWith': { 'afterRearg': true, 'start': 1 }, 'assignAllWith': { 'start': 0 },
'assignInAll': { 'start': 0 }, 'assignInAll': { 'start': 0 },
'assignInAllWith': { 'afterRearg': true, 'start': 1 }, 'assignInAllWith': { 'start': 0 },
'defaultsAll': { 'start': 0 }, 'defaultsAll': { 'start': 0 },
'defaultsDeepAll': { 'start': 0 }, 'defaultsDeepAll': { 'start': 0 },
'invokeArgs': { 'start': 2 }, 'invokeArgs': { 'start': 2 },
'invokeArgsMap': { 'start': 2 }, 'invokeArgsMap': { 'start': 2 },
'mergeAll': { 'start': 0 }, 'mergeAll': { 'start': 0 },
'mergeAllWith': { 'afterRearg': true, 'start': 1 }, 'mergeAllWith': { 'start': 0 },
'partial': { 'start': 1 }, 'partial': { 'start': 1 },
'partialRight': { 'start': 1 }, 'partialRight': { 'start': 1 },
'without': { 'start': 1 }, 'without': { 'start': 1 },

View File

@@ -10822,6 +10822,7 @@
if (array) { if (array) {
arrayPush(otherArgs, array); arrayPush(otherArgs, array);
} }
arrayPush(otherArgs, castSlice(args, start + 1));
return apply(func, this, otherArgs); return apply(func, this, otherArgs);
}); });
} }

View File

@@ -20866,8 +20866,8 @@
args = slice.call(arguments); args = slice.call(arguments);
}); });
spread([4, 2], 'ignored'); spread([1, 2], 3);
assert.deepEqual(args, [4, 2]); assert.deepEqual(args, [1, 2, 3]);
}); });
QUnit.test('should work with `start`', function(assert) { QUnit.test('should work with `start`', function(assert) {