mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-05 01:17:50 +00:00
Ensure underscore build internal forOwn will accept a thisArg argument. [closes #220].
Former-commit-id: a7818db29e81b64556232bfe44b2e1275d3dada1
This commit is contained in:
6
dist/lodash.underscore.js
vendored
6
dist/lodash.underscore.js
vendored
@@ -705,7 +705,6 @@
|
||||
var index, iterable = collection, result = iterable;
|
||||
if (!iterable) return result;
|
||||
if (!objectTypes[typeof iterable]) return result;
|
||||
callback || (callback = identity);
|
||||
|
||||
for (index in iterable) {
|
||||
if (callback(iterable[index], index, collection) === indicatorObject) return result;
|
||||
@@ -738,7 +737,6 @@
|
||||
var index, iterable = collection, result = iterable;
|
||||
if (!iterable) return result;
|
||||
if (!objectTypes[typeof iterable]) return result;
|
||||
callback || (callback = identity);
|
||||
|
||||
for (index in iterable) {
|
||||
if (hasOwnProperty.call(iterable, index)) {
|
||||
@@ -1683,15 +1681,15 @@
|
||||
var index = -1,
|
||||
length = collection ? collection.length : 0;
|
||||
|
||||
callback = callback && typeof thisArg == 'undefined' ? callback : createCallback(callback, thisArg);
|
||||
if (typeof length == 'number') {
|
||||
callback = callback && typeof thisArg == 'undefined' ? callback : createCallback(callback, thisArg);
|
||||
while (++index < length) {
|
||||
if (callback(collection[index], index, collection) === indicatorObject) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
forOwn(collection, callback, thisArg);
|
||||
forOwn(collection, callback);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user