Update docs and builds.

Former-commit-id: 27acae75d0412c0e94caa857d861522cbbc6b1a8
This commit is contained in:
John-David Dalton
2013-07-21 23:50:34 -07:00
parent 2e5de88445
commit eaa9430e26
7 changed files with 258 additions and 246 deletions

View File

@@ -546,21 +546,22 @@
* @returns {Function} Returns the new bound function.
*/
function createBound(func, thisArg, partialArgs, partialRightArgs, isPartial, isAlt) {
var isFunc = isFunction(func);
var isBindKey = isAlt && !isPartial,
isFunc = isFunction(func);
// except for `_.bindKey`, throw when `func` is not a function
if (!isFunc && (isPartial || !isAlt)) {
// throw if `func` is not a function when not behaving as `_.bindKey`
if (!isFunc && !isBindKey) {
throw new TypeError;
}
var key = thisArg;
// juggle arguments for `_.bindKey`
if (!isPartial && isAlt) {
// juggle arguments for `_.bindKey` behavior
if (isBindKey) {
thisArg = func;
}
// use `Function#bind` if it exists and is fast
// (in V8 `Function#bind` is slower except when partially applied)
if (!isPartial && !isAlt && (support.fastBind || (nativeBind && partialArgs.length))) {
if (!isPartial && !isAlt && !partialRightArgs.length && (support.fastBind || (nativeBind && partialArgs.length))) {
var bound = nativeBind.call.apply(nativeBind, concat.call(arrayRef, func, thisArg, partialArgs));
}
else {
@@ -570,7 +571,7 @@
var args = arguments,
thisBinding = isPartial ? this : thisArg;
if (!isFunc) {
if (isBindKey) {
func = thisArg[key];
}
if (partialArgs.length || partialRightArgs.length) {
@@ -3475,6 +3476,7 @@
}
var type = typeof func;
if (type != 'function') {
// handle "_.pluck" style callback shorthands
if (type != 'object') {
return function(object) {
return object[func];