mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-01 15:57:48 +00:00
Ensure _.bind correctly appends array arguments to partially applied arguments.
Former-commit-id: 4fdb100f83ff9a0eafcba3f5bf91872748205595
This commit is contained in:
@@ -3224,7 +3224,7 @@
|
||||
}
|
||||
if (partialArgs.length) {
|
||||
args = args.length
|
||||
? concat.apply(partialArgs, args)
|
||||
? partialArgs.concat(slice.call(args))
|
||||
: partialArgs;
|
||||
}
|
||||
if (this instanceof bound) {
|
||||
|
||||
@@ -143,6 +143,14 @@
|
||||
QUnit.module('lodash.bind');
|
||||
|
||||
(function() {
|
||||
test('should correctly append array arguments to partially applied arguments (test in IE < 9)', function() {
|
||||
var args,
|
||||
bound = _.bind(function() { args = slice.call(arguments); }, null, 'a');
|
||||
|
||||
bound(['b'], 'c');
|
||||
deepEqual(args, ['a', ['b'], 'c']);
|
||||
});
|
||||
|
||||
test('supports lazy bind', function() {
|
||||
var object = {
|
||||
'name': 'moe',
|
||||
|
||||
Reference in New Issue
Block a user