mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-29 06:27:49 +00:00
don't use root as the default 'this' for a bound function, use an empty object instead.
This commit is contained in:
@@ -366,7 +366,7 @@
|
||||
_.bind = function(func, obj) {
|
||||
var args = _.rest(arguments, 2);
|
||||
return function() {
|
||||
return func.apply(obj || root, args.concat(_.toArray(arguments)));
|
||||
return func.apply(obj || {}, args.concat(_.toArray(arguments)));
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user