Remove unnecessary usage of Function.prototype.bind (#7783) but maintain API. Also fix bug with proxy failing when a name is provided. Fixes #8893.

This commit is contained in:
John Resig 2011-04-17 14:11:40 -07:00 committed by timmywil
parent 2a71493447
commit 15da298f72
3 changed files with 13 additions and 36 deletions

View file

@ -910,7 +910,7 @@ test("jQuery.isEmptyObject", function(){
});
test("jQuery.proxy", function(){
expect(6);
expect(7);
var test = function(){ equals( this, thisObject, "Make sure that scope is set properly." ); };
var thisObject = { foo: "bar", method: test };
@ -921,6 +921,9 @@ test("jQuery.proxy", function(){
// Basic scoping
jQuery.proxy( test, thisObject )();
// Another take on it
jQuery.proxy( thisObject, "method" )();
// Make sure it doesn't freak out
equals( jQuery.proxy( null, thisObject ), undefined, "Make sure no function was returned." );