diff options
author | Gianni Chiappetta <gianni@runlevel6.org> | 2010-12-18 19:17:37 -0500 |
---|---|---|
committer | Gianni Chiappetta <gianni@runlevel6.org> | 2010-12-18 19:17:37 -0500 |
commit | 6bc9fc7c10a6dd2c8c7132307e63323a1f59d35f (patch) | |
tree | 6e54206bdc5c74d8ed18262e630b3bc2e040ffae /src/core.js | |
parent | 1ebb5ab3e1c670e04024cd949fa6f341e93c4487 (diff) | |
download | jquery-6bc9fc7c10a6dd2c8c7132307e63323a1f59d35f.tar.gz jquery-6bc9fc7c10a6dd2c8c7132307e63323a1f59d35f.zip |
Perf. improvement based on fearphage's suggestion (direct vs call vs apply).
Diffstat (limited to 'src/core.js')
-rw-r--r-- | src/core.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/core.js b/src/core.js index a6e2a46f8..2ffcb911a 100644 --- a/src/core.js +++ b/src/core.js @@ -754,7 +754,11 @@ jQuery.extend({ if ( jQuery.support.nativeBind ) { // Native bind args = slice.call( arguments, 1 ); - proxy = Function.prototype.bind.apply( fn, args ); + if ( args.length ) { + proxy = Function.prototype.bind.apply( fn, args ); + } else { + proxy = fn.bind( context ); + } } else { // Simulated bind args = slice.call( arguments, 2 ); |