Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix bug in bind causing loss of arguments

Empty Arrays are truthy

Fixes issue #574
  • Loading branch information...
commit 7a9b504e754e439888d8a0296f17542dfd5cd949 1 parent b333f86
@johtso johtso authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  src/core/Util.js
View
2  src/core/Util.js
@@ -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);
};
Please sign in to comment.
Something went wrong with that request. Please try again.