Remove falsey checks and reduce file size.

Former-commit-id: 5263a0beaffe2a987eb65fd3631ea4aff8d9f000
This commit is contained in:
John-David Dalton
2012-09-28 00:46:57 -07:00
parent 30666aa111
commit 7036ed5e2f
5 changed files with 80 additions and 232 deletions

View File

@@ -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'],