mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-08 10:17:48 +00:00
Add _.restParam test for functions with more than 3 params.
This commit is contained in:
@@ -12569,6 +12569,14 @@
|
|||||||
deepEqual(rp(1), [1, undefined, []]);
|
deepEqual(rp(1), [1, undefined, []]);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('should work on functions with more than 3 params', 1, function() {
|
||||||
|
var rp = _.restParam(function(a, b, c, d) {
|
||||||
|
return slice.call(arguments);
|
||||||
|
});
|
||||||
|
|
||||||
|
deepEqual(rp(1, 2, 3, 4, 5), [1, 2, 3, [4, 5]]);
|
||||||
|
});
|
||||||
|
|
||||||
test('should not set a `this` binding', 1, function() {
|
test('should not set a `this` binding', 1, function() {
|
||||||
var rp = _.restParam(function(x, y) {
|
var rp = _.restParam(function(x, y) {
|
||||||
return this[x] + this[y[0]];
|
return this[x] + this[y[0]];
|
||||||
|
|||||||
Reference in New Issue
Block a user