Bump to v3.6.0.

This commit is contained in:
jdalton
2015-03-24 16:44:49 -07:00
parent 06f6ffa303
commit d58549ce0b
192 changed files with 2218 additions and 1804 deletions

View File

@@ -1,6 +1,10 @@
var baseBindAll = require('../internal/baseBindAll'),
baseFlatten = require('../internal/baseFlatten'),
functions = require('../object/functions');
var baseFlatten = require('../internal/baseFlatten'),
createWrapper = require('../internal/createWrapper'),
functions = require('../object/functions'),
restParam = require('./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 @@ var baseBindAll = require('../internal/baseBindAll'),
* 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;
});
module.exports = bindAll;