mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-05 09:27:49 +00:00
Ensure underscore build internal forOwn will accept a thisArg argument. [closes #220].
Former-commit-id: a7818db29e81b64556232bfe44b2e1275d3dada1
This commit is contained in:
6
build.js
6
build.js
@@ -1865,15 +1865,15 @@
|
||||
' var index = -1,',
|
||||
' length = collection ? collection.length : 0;',
|
||||
'',
|
||||
" callback = callback && typeof thisArg == 'undefined' ? callback : lodash.createCallback(callback, thisArg);",
|
||||
" if (typeof length == 'number') {",
|
||||
" callback = callback && typeof thisArg == 'undefined' ? callback : lodash.createCallback(callback, thisArg);",
|
||||
' while (++index < length) {',
|
||||
' if (callback(collection[index], index, collection) === false) {',
|
||||
' break;',
|
||||
' }',
|
||||
' }',
|
||||
' } else {',
|
||||
' each(collection, callback, thisArg);',
|
||||
' each(collection, callback);',
|
||||
' }',
|
||||
' return collection;',
|
||||
'}',
|
||||
@@ -2627,7 +2627,7 @@
|
||||
source = source.replace(matchFunction(source, data.methodName), function(match) {
|
||||
return match
|
||||
.replace(/(callback), *thisArg/g, '$1')
|
||||
.replace(/^( *)callback *=.+/m, '$1callback || (callback = identity);')
|
||||
.replace(/^ *callback *=.+\n/m, '');
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user