diff --git a/lodash.src.js b/lodash.src.js index 2b93561c5..98b3180d7 100644 --- a/lodash.src.js +++ b/lodash.src.js @@ -3213,7 +3213,8 @@ var Ctor = createCtorWrapper(func); function wrapper() { - return (this instanceof wrapper ? Ctor : func).apply(thisArg, arguments); + var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; + return fn.apply(thisArg, arguments); } return wrapper; } @@ -3416,7 +3417,8 @@ if (isAry && ary < args.length) { args.length = ary; } - return (this instanceof wrapper ? (Ctor || createCtorWrapper(func)) : func).apply(thisBinding, args); + var fn = (this && this !== root && this instanceof wrapper) ? (Ctor || createCtorWrapper(func)) : func; + return fn.apply(thisBinding, args); } return wrapper; } @@ -3475,7 +3477,8 @@ while (argsLength--) { args[leftIndex++] = arguments[++argsIndex]; } - return (this instanceof wrapper ? Ctor : func).apply(isBind ? thisArg : this, args); + var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; + return fn.apply(isBind ? thisArg : this, args); } return wrapper; }