From 14c6a1bf2383c6376bface5125fa0504c6f34b48 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Tue, 22 Oct 2013 09:27:33 -0700 Subject: [PATCH] Add docs to an advanced section of `createBound`. [ci skip] --- lodash.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lodash.js b/lodash.js index 99abb675e..0c7b6de4f 100644 --- a/lodash.js +++ b/lodash.js @@ -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); }