diff --git a/lodash.js b/lodash.js index 074af1702..0922cfd9a 100644 --- a/lodash.js +++ b/lodash.js @@ -8505,8 +8505,8 @@ * The guarded methods are: * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`, * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`, - * `sampleSize`, `slice`, `some`, `sortBy`, `take`, `takeRight`, `template`, - * `trim`, `trimEnd`, `trimStart`, and `words` + * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`, + * `template`, `trim`, `trimEnd`, `trimStart`, and `words` * * @static * @memberOf _ @@ -13561,6 +13561,9 @@ */ function split(string, separator, limit) { string = toString(string); + if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) { + separator = limit = undefined; + } if (string && ( typeof separator == 'string' || (separator != null && !isRegExp(separator)) diff --git a/test/test.js b/test/test.js index 39f27b88c..51db4e967 100644 --- a/test/test.js +++ b/test/test.js @@ -20115,6 +20115,15 @@ assert.deepEqual(actual, expected); }); + QUnit.test('should work as an iteratee for methods like `_.map`', function(assert) { + assert.expect(1); + + var strings = ['abc', 'def', 'ghi'], + actual = lodashStable.map(strings, _.split); + + assert.deepEqual(actual, [['abc'], ['def'], ['ghi']]); + }); + QUnit.test('should allow mixed string and array prototype methods', function(assert) { assert.expect(1);