From 4beadcc4f3bd21603307cb43a31ce1ebc337cb8a Mon Sep 17 00:00:00 2001 From: jdalton Date: Tue, 2 Jun 2015 21:04:18 -0700 Subject: [PATCH] Add `this` binding test for `_.modArgs`. --- test/test.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/test.js b/test/test.js index 9c88789c1..776cd0532 100644 --- a/test/test.js +++ b/test/test.js @@ -11377,6 +11377,17 @@ var modded = _.modArgs(fn, doubled, _.identity); deepEqual(modded(5), [10]); }); + + test('should not set a `this` binding', 1, function() { + var modded = _.modArgs(function(x) { + return this[x]; + }, function(x) { + return this === x; + }); + + var object = { 'modded': modded, 'false': 1 }; + strictEqual(object.modded(object), 1); + }); }()); /*--------------------------------------------------------------------------*/