Ensure underscore build internal forOwn will accept a thisArg argument. [closes #220].

Former-commit-id: a7818db29e81b64556232bfe44b2e1275d3dada1
This commit is contained in:
John-David Dalton
2013-03-26 20:46:02 -07:00
parent 2c7cc2c191
commit d77c9d3fca
6 changed files with 22 additions and 12 deletions

4
dist/lodash.js vendored
View File

@@ -2346,15 +2346,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 {
forOwn(collection, callback, thisArg);
forOwn(collection, callback);
}
return collection;
}