mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-07 18:07:49 +00:00
Ensure _.times doesn't error when passed negative numbers.
Former-commit-id: 5d694743fbda0f477250fe3c90cf29168834ac6f
This commit is contained in:
13
build.js
13
build.js
@@ -2170,6 +2170,19 @@
|
||||
'}'
|
||||
].join('\n'));
|
||||
|
||||
// replace `_.times`
|
||||
source = replaceFunction(source, 'times', [
|
||||
'function times(n, callback, thisArg) {',
|
||||
' var index = -1,',
|
||||
' result = Array(n > -1 ? n : 0);',
|
||||
'',
|
||||
' while (++index < n) {',
|
||||
' result[index] = callback.call(thisArg, index);',
|
||||
' }',
|
||||
' return result;',
|
||||
'}'
|
||||
].join('\n'));
|
||||
|
||||
// replace `_.uniq`
|
||||
source = replaceFunction(source, 'uniq', [
|
||||
'function uniq(array, isSorted, callback, thisArg) {',
|
||||
|
||||
Reference in New Issue
Block a user