From 23354d413f4af5a9bfcda940cca7a090e5bcdf7f Mon Sep 17 00:00:00 2001 From: jdalton Date: Sat, 11 Apr 2015 22:14:00 -0700 Subject: [PATCH] Add an `_.invoke` test for deep paths. --- test/test.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/test.js b/test/test.js index 9f602619f..f2dbfc0ef 100644 --- a/test/test.js +++ b/test/test.js @@ -6883,6 +6883,14 @@ deepEqual(actual, expected); }); + + test('should invoke deep property methods with the correct `this` binding', 2, function() { + var object = { 'a': { 'b': function() { this.c; }, 'c': 1 } }; + + _.each(['a.b', ['a', 'b']], function(path) { + deepEqual(_.invoke([object], path), [1]); + }); + }); }()); /*--------------------------------------------------------------------------*/