Add docs to an advanced section of createBound. [ci skip]

This commit is contained in:
John-David Dalton
2013-10-22 09:27:33 -07:00
parent b27dfd4c77
commit 14c6a1bf23

View File

@@ -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);
}