mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-09 18:37:50 +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) {
|
if (partialArgs.length) {
|
||||||
args = args.length
|
args = args.length
|
||||||
? concat.apply(partialArgs, args)
|
? partialArgs.concat(slice.call(args))
|
||||||
: partialArgs;
|
: partialArgs;
|
||||||
}
|
}
|
||||||
if (this instanceof bound) {
|
if (this instanceof bound) {
|
||||||
|
|||||||
@@ -143,6 +143,14 @@
|
|||||||
QUnit.module('lodash.bind');
|
QUnit.module('lodash.bind');
|
||||||
|
|
||||||
(function() {
|
(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() {
|
test('supports lazy bind', function() {
|
||||||
var object = {
|
var object = {
|
||||||
'name': 'moe',
|
'name': 'moe',
|
||||||
|
|||||||
Reference in New Issue
Block a user