Cleanup fix for modularize underscore and _.mixin and add tests for correct indicatorObject use in underscore builds.

Former-commit-id: 7700fb4df90cdc3eca47af037677d71a70908616
This commit is contained in:
John-David Dalton
2013-08-06 09:07:45 -07:00
parent 3c626e3ea5
commit fff5ae97f2
10 changed files with 317 additions and 279 deletions

25
dist/lodash.js vendored
View File

@@ -1650,7 +1650,7 @@
*/
function findLastKey(object, callback, thisArg) {
var result;
callback = lodash.createCallback(callback, thisArg);
callback = lodash.createCallback(callback, thisArg, 3);
forOwnRight(object, function(value, key, object) {
if (callback(value, key, object)) {
result = key;
@@ -1727,17 +1727,16 @@
* // => logs 'name' and 'bark' assuming `_.forIn ` logs 'bark' and 'name'
*/
function forInRight(object, callback, thisArg) {
var index = -1,
pairs = [];
var pairs = [];
forIn(object, function(value, key) {
pairs.push(value, key);
pairs.push(key, value);
});
var length = pairs.length;
callback = baseCreateCallback(callback, thisArg, 3);
while (++index < length) {
if (callback(pairs[index], pairs[++index], object) === false) {
while (length--) {
if (callback(pairs[length--], pairs[length], object) === false) {
break;
}
}
@@ -2868,7 +2867,7 @@
*/
function findLast(collection, callback, thisArg) {
var result;
callback = lodash.createCallback(callback, thisArg);
callback = lodash.createCallback(callback, thisArg, 3);
forEachRight(collection, function(value, index, collection) {
if (callback(value, index, collection)) {
result = value;
@@ -2945,7 +2944,7 @@
callback = baseCreateCallback(callback, thisArg, 3);
forEach(collection, function(value, index, collection) {
index = props ? props[--length] : --length;
callback(iterable[index], index, collection);
return callback(iterable[index], index, collection);
});
return collection;
}
@@ -3835,13 +3834,11 @@
* // => 2
*/
function findLastIndex(array, callback, thisArg) {
var index = -1,
length = array ? array.length : 0;
callback = lodash.createCallback(callback, thisArg);
var length = array ? array.length : 0;
callback = lodash.createCallback(callback, thisArg, 3);
while (length--) {
if (callback(array[index], index, array)) {
return index;
if (callback(array[length], length, array)) {
return length;
}
}
return -1;