aboutsummaryrefslogtreecommitdiffstats
path: root/src/core.js
diff options
context:
space:
mode:
authorGianni Chiappetta <gianni@runlevel6.org>2010-12-18 19:17:37 -0500
committerGianni Chiappetta <gianni@runlevel6.org>2010-12-18 19:17:37 -0500
commit6bc9fc7c10a6dd2c8c7132307e63323a1f59d35f (patch)
tree6e54206bdc5c74d8ed18262e630b3bc2e040ffae /src/core.js
parent1ebb5ab3e1c670e04024cd949fa6f341e93c4487 (diff)
downloadjquery-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.js6
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 );