From e7b4ada65f442e4a007b296e18bd3c8189909718 Mon Sep 17 00:00:00 2001 From: jdalton Date: Mon, 23 Mar 2015 09:06:45 -0700 Subject: [PATCH] Add `_.restParam` test for functions with more than 3 params. --- test/test.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/test.js b/test/test.js index 816222a91..5c2f08b24 100644 --- a/test/test.js +++ b/test/test.js @@ -12569,6 +12569,14 @@ 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() { var rp = _.restParam(function(x, y) { return this[x] + this[y[0]];