mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-31 23:37:49 +00:00
Optimize createBindWrapper, createPartialWrapper, and createHybridWrapper.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user