Avoid returning assignDefaults if no object is provided to _.defaults.

This commit is contained in:
John-David Dalton
2014-03-15 00:33:55 -07:00
parent 65f125d998
commit 0a2dd2a330
2 changed files with 11 additions and 4 deletions

View File

@@ -2983,6 +2983,10 @@
_.forEach(['assign', 'defaults', 'merge'], function(methodName) {
var func = _[methodName];
test('`_.' + methodName + '` should return `undefined` when no destination object is provided', 1, function() {
strictEqual(func(), undefined);
});
test('`_.' + methodName + '` should return the existing wrapper when chaining', 1, function() {
if (!isNpm) {
var wrapper = _({ 'a': 1 });