mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-02 16:17:50 +00:00
Ensure _.every and _.some work in Underscore builds without the "exit early" feature of _.forEach and reduce unexposed forIn and forOwn.
Former-commit-id: 35488c1c0f70cb5446c875bd4647b0ce47077d9e
This commit is contained in:
@@ -631,15 +631,16 @@
|
||||
return false;
|
||||
});
|
||||
|
||||
var object = { 'fn': lodash.bind(function(x) { return this.x + x; }, { 'x': 1 }, 1) };
|
||||
equal(object.fn(), 2, '_.bind: ' + basename);
|
||||
|
||||
ok(lodash.clone(array, true)[0] === array[0], '_.clone: ' + basename);
|
||||
equal(last.value, 2, '_.each: ' + basename);
|
||||
equal(lodash.every([true, false, true]), false, '_.every: ' + basename);
|
||||
|
||||
var object = { 'length': 0, 'splice': Array.prototype.splice };
|
||||
object = { 'length': 0, 'splice': Array.prototype.splice };
|
||||
equal(lodash.isEmpty(object), false, '_.isEmpty: ' + basename);
|
||||
|
||||
object = { 'fn': lodash.bind(function(x) { return this.x + x; }, { 'x': 1 }, 1) };
|
||||
equal(object.fn(), 2, '_.bind: ' + basename);
|
||||
|
||||
// avoid issues comparing objects with `deepEqual`
|
||||
object = { 'a': 1, 'b': 2, 'c': 3 };
|
||||
var actual = lodash.omit(object, function(value) { return value == 3; });
|
||||
@@ -647,6 +648,8 @@
|
||||
|
||||
actual = lodash.pick(object, function(value) { return value != 3; });
|
||||
deepEqual(_.keys(actual), [], '_.pick: ' + basename);
|
||||
|
||||
equal(lodash.some([false, true, false]), true, '_.some: ' + basename);
|
||||
start();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user