8000 Ensure `_.bind` correctly appends array arguments to partially applie… · lodash/lodash@0442578 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0442578

Browse files
committed
Ensure _.bind correctly appends array arguments to partially applied arguments.
Former-commit-id: 4fdb100f83ff9a0eafcba3f5bf91872748205595
1 parent 15b14e1 commit 0442578

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

lodash.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3224,7 +3224,7 @@
32243224
}
32253225
if (partialArgs.length) {
32263226
args = args.length
3227-
? concat.apply(partialArgs, args)
3227+
? partialArgs.concat(slice.call(args))
32283228
: partialArgs;
32293229
}
32303230
if (this instanceof bound) {

test/test.js

+8
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,14 @@
143143
QUnit.module('lodash.bind');
144144

145145
(function() {
146+
test('should correctly append array arguments to partially applied 83A1 arguments (test in IE < 9)', function() {
147+
var args,
148+
bound = _.bind(function() { args = slice.call(arguments); }, null, 'a');
149+
150+
bound(['b'], 'c');
151+
deepEqual(args, ['a', ['b'], 'c']);
152+
});
153+
146154
test('supports lazy bind', function() {
147155
var object = {
148156
'name': 'moe',

0 commit comments

Comments
 (0)
0