Bump to v3.6.0.

This commit is contained in:
jdalton
2015-03-24 19:28:36 -07:00
parent ee1f12c851
commit 801ffd8adf
193 changed files with 1213 additions and 976 deletions

View File

@@ -1,6 +1,10 @@
import baseBindAll from '../internal/baseBindAll';
import baseFlatten from '../internal/baseFlatten';
import createWrapper from '../internal/createWrapper';
import functions from '../object/functions';
import restParam from './restParam';
/** Used to compose bitmasks for wrapper metadata. */
var BIND_FLAG = 1;
/**
* Binds methods of an object to the object itself, overwriting the existing
@@ -30,12 +34,17 @@ import functions from '../object/functions';
* jQuery('#docs').on('click', view.onClick);
* // => logs 'clicked docs' when the element is clicked
*/
function bindAll(object) {
return baseBindAll(object,
arguments.length > 1
? baseFlatten(arguments, false, false, 1)
: functions(object)
);
}
var bindAll = restParam(function(object, methodNames) {
methodNames = methodNames.length ? baseFlatten(methodNames) : functions(object);
var index = -1,
length = methodNames.length;
while (++index < length) {
var key = methodNames[index];
object[key] = createWrapper(object[key], BIND_FLAG, object);
}
return object;
});
export default bindAll;