mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-01 15:57:48 +00:00
Add docs to an advanced section of createBound. [ci skip]
This commit is contained in:
@@ -1589,21 +1589,28 @@
|
||||
var bindData = func && func.__bindData__;
|
||||
if (bindData && bindData !== true) {
|
||||
bindData = nativeSlice.call(bindData);
|
||||
|
||||
// set `thisBinding` is not previously bound
|
||||
if (isBind && !(bindData[1] & 1)) {
|
||||
bindData[4] = thisArg;
|
||||
}
|
||||
// set if previously bound but not currently (subsequent curried functions)
|
||||
if (!isBind && bindData[1] & 1) {
|
||||
bitmask |= 8;
|
||||
}
|
||||
// set curried arity if not yet set
|
||||
if (isCurry && !(bindData[1] & 4)) {
|
||||
bindData[5] = arity;
|
||||
}
|
||||
// append partial left arguments
|
||||
if (isPartial) {
|
||||
push.apply(bindData[2] || (bindData[2] = []), partialArgs);
|
||||
}
|
||||
// append partial right arguments
|
||||
if (isPartialRight) {
|
||||
push.apply(bindData[3] || (bindData[3] = []), partialRightArgs);
|
||||
}
|
||||
// merge flags
|
||||
bindData[1] |= bitmask;
|
||||
return createBound.apply(null, bindData);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user