File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change 3998
3998
* @returns {* } Returns the metadata for `func`.
3999
3999
*/
4000
4000
var getData = ! metaMap ? noop : function ( func ) {
4001
- return metaMap . get ( func ) ;
4001
+ return typeof func == 'function' ? metaMap . get ( func ) : undefined ;
4002
4002
} ;
4003
4003
4004
4004
/**
Original file line number Diff line number Diff line change 3379
3379
fn = function(a, b) { return slice.call(arguments); },
3380
3380
isCurry = methodName == 'curry';
3381
3381
3382
+ test('`_.' + methodName + '` should not error on functions with the same name as lodash methods', 1, function() {
3383
+ function run(a, b) {
3384
+ return a + b;
3385
+ }
3386
+
3387
+ var curried = func(run);
3388
+
3389
+ try {
3390
+ var actual = curried(1)(2);
3391
+ } catch(e) {}
3392
+
3393
+ strictEqual(actual, 3);
3394
+ });
3395
+
3382
3396
test('`_.' + methodName + '` should work as an iteratee for methods like `_.map`', 2, function() {
3383
3397
var array = [fn, fn, fn],
3384
3398
object = { 'a': fn, 'b': fn, 'c': fn };
You can’t perform that action at this time.
0 commit comments