mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-01 23:57:49 +00:00
updated bind method to stop un-needed variable assignment when using native method.
This commit is contained in:
@@ -409,8 +409,8 @@
|
||||
// optionally). Binding with arguments is also known as `curry`.
|
||||
// Delegates to **ECMAScript 5**'s native `Function.bind` if available.
|
||||
_.bind = function(func, obj) {
|
||||
var args = slice.call(arguments, 2);
|
||||
if(nativeBind && func.bind === nativeBind) return FuncProto.bind.apply(func, slice.call(arguments, 1));
|
||||
var args = slice.call(arguments, 2);
|
||||
return function() {
|
||||
return func.apply(obj || {}, args.concat(slice.call(arguments)));
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user