Ensure the second argument passed to _.assign is not treated as a callback. [closes #184]

Former-commit-id: 1254e11ab02d1d5055c08400cd0a4786ed71aef2
This commit is contained in:
John-David Dalton
2013-02-15 08:11:19 -08:00
parent 7ea7a6cbb1
commit 02687f3c78
6 changed files with 32 additions and 41 deletions

View File

@@ -952,12 +952,15 @@
deepEqual(actual, { 'a': 2 });
});
test('lodash.' + methodName + ' should not treat a function as a `callback` if less than two arguments are passed', function() {
test('lodash.' + methodName + ' should not treat the second argument as a `callback`', function() {
function callback() {}
callback.b = 2;
var actual = func({ 'a': 1 }, callback);
deepEqual(actual, { 'a': 1, 'b': 2 });
actual = func({ 'a': 1 }, callback, { 'c': 3 });
deepEqual(actual, { 'a': 1, 'b': 2, 'c': 3 });
});
});