mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-01 15:57:48 +00:00
Remove falsey checks and reduce file size.
Former-commit-id: 5263a0beaffe2a987eb65fd3631ea4aff8d9f000
This commit is contained in:
39
test/test.js
39
test/test.js
@@ -394,7 +394,7 @@
|
||||
} else {
|
||||
func(object, { 'a': 1 });
|
||||
}
|
||||
} catch(e) {
|
||||
} catch(e) {console.log(e);
|
||||
pass = false;
|
||||
}
|
||||
ok(pass);
|
||||
@@ -1696,43 +1696,6 @@
|
||||
QUnit.module('lodash methods');
|
||||
|
||||
(function() {
|
||||
test('should allow falsey arguments', function() {
|
||||
var funcs = _.without.apply(_, [_.functions(_)].concat([
|
||||
'_',
|
||||
'_iteratorTemplate',
|
||||
'_shimKeys',
|
||||
'after',
|
||||
'bind',
|
||||
'bindAll',
|
||||
'compose',
|
||||
'debounce',
|
||||
'defer',
|
||||
'delay',
|
||||
'functions',
|
||||
'memoize',
|
||||
'once',
|
||||
'partial',
|
||||
'tap',
|
||||
'throttle',
|
||||
'wrap'
|
||||
]));
|
||||
|
||||
_.each(funcs, function(methodName) {
|
||||
var func = _[methodName],
|
||||
pass = true;
|
||||
|
||||
_.each(falsey, function(value, index) {
|
||||
try {
|
||||
index ? func(value) : func();
|
||||
} catch(e) {
|
||||
pass = false;
|
||||
}
|
||||
});
|
||||
|
||||
ok(pass, '_.' + methodName + ' allows falsey arguments');
|
||||
});
|
||||
});
|
||||
|
||||
test('should handle `null` `thisArg` arguments', function() {
|
||||
var thisArg,
|
||||
array = ['a'],
|
||||
|
||||
Reference in New Issue
Block a user