Ensure _.callback doesn't error if provided a nullish func argument and a thisArg.

This commit is contained in:
John-David Dalton
2014-05-01 01:12:40 -07:00
parent d07e53e9a0
commit 1a03ee8b9b
2 changed files with 13 additions and 1 deletions

View File

@@ -7790,7 +7790,7 @@
function createCallback(func, thisArg, argCount) {
var type = typeof func;
if (type == 'function' || func == null) {
return (typeof thisArg == 'undefined' || !('prototype' in func)) &&
return (typeof thisArg == 'undefined' || !(func && 'prototype' in func)) &&
func || baseCreateCallback(func, thisArg, argCount);
}
// handle "_.pluck" and "_.where" style callback shorthands