Fix bug in bind causing loss of arguments
Empty Arrays are truthy Fixes issue #574
This commit is contained in:
parent
b333f86e1d
commit
7a9b504e75
@ -17,7 +17,7 @@ L.Util = {
|
||||
},
|
||||
|
||||
bind: function (fn, obj) { // (Function, Object) -> Function
|
||||
var args = Array.prototype.slice.call(arguments, 2);
|
||||
var args = arguments.length > 2 ? Array.prototype.slice.call(arguments, 2) : null;
|
||||
return function () {
|
||||
return fn.apply(obj, args || arguments);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user