added: Backcompatibility with old proxy syntax.

This commit is contained in:
Gianni Chiappetta 2011-01-21 10:33:50 -05:00
parent a03f040dbf
commit 574ae3b1be
2 changed files with 11 additions and 1 deletions

View file

@ -739,6 +739,12 @@ jQuery.extend({
proxy: function( fn, context ) {
var args, proxy;
// XXX BACKCOMPAT: Support old string method.
if ( typeof context === "string" ) {
fn = fn[ context ];
context = arguments[0];
}
// Quick check to determine if target is callable, in the spec
// this throws a TypeError, but we will just return undefined.
if ( ! jQuery.isFunction( fn ) ) {