mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-05 09:27:49 +00:00
Ensure the second argument passed to _.assign is not treated as a callback. [closes #184]
Former-commit-id: 1254e11ab02d1d5055c08400cd0a4786ed71aef2
This commit is contained in:
@@ -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 });
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user