diff --git a/lodash.js b/lodash.js index 90eacd229..b469c01be 100644 --- a/lodash.js +++ b/lodash.js @@ -5019,7 +5019,7 @@ * may be applied regardless of execution order. Methods like `_.ary` and `_.rearg` * modify function arguments, making the order in which they are executed important, * preventing the merging of metadata. However, we make an exception for a safe - * common case where curried functions have `_.ary` and or `_.rearg` applied. + * combined case where curried functions have `_.ary` and or `_.rearg` applied. * * @private * @param {Array} data The destination metadata. @@ -5030,7 +5030,7 @@ var bitmask = data[1], srcBitmask = source[1], newBitmask = bitmask | srcBitmask, - isCommon = newBitmask < ARY_FLAG; + isCommon = newBitmask < ARY_FLAG || newBitmask == ARY_FLAG; var isCombo = (srcBitmask == ARY_FLAG && (bitmask == CURRY_FLAG)) || diff --git a/test/test.js b/test/test.js index d18a88f5e..b7f35817c 100644 --- a/test/test.js +++ b/test/test.js @@ -1054,6 +1054,13 @@ assert.deepEqual(capped('a'), ['a']); }); + QUnit.test('should use the existing `ary` if smaller', function(assert) { + assert.expect(1); + + var capped = _.ary(_.ary(fn, 1), 2); + assert.deepEqual(capped('a', 'b', 'c'), ['a']); + }); + QUnit.test('should work as an iteratee for methods like `_.map`', function(assert) { assert.expect(1);