Added support for ECMAScript 5 native bind method if available. Additional unit test to cover multiple argument binds.

This commit is contained in:
Adam Craven
2011-02-20 21:03:52 +01:00
parent 226b7d9344
commit 9c9731e08e
2 changed files with 8 additions and 2 deletions

View File

@@ -20,6 +20,10 @@ $(document).ready(function() {
var func = _.bind(func, this, 'curly');
equals(func(), 'hello: curly', 'the function was completely applied in advance');
var func = function(salutation, firstname, lastname) { return salutation + ': ' + firstname + ' ' + lastname };
func = _.bind(func, this, 'hello', 'moe', 'curly');
equals(func(), 'hello: moe curly', 'the function was partially applied in advance and can accept multiple arguments');
});
test("functions: bindAll", function() {