aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGianni Chiappetta <gianni@runlevel6.org>2010-12-15 18:31:10 -0500
committerGianni Chiappetta <gianni@runlevel6.org>2010-12-15 18:31:10 -0500
commit5b1b57850cfd4c92a4f9231581dff7faac489566 (patch)
tree2fd550c6d06b7ce01b0e03a92c07a485d48f94ad
parent9f8cd6c499844451468257140e71f611abb3a040 (diff)
downloadjquery-5b1b57850cfd4c92a4f9231581dff7faac489566.tar.gz
jquery-5b1b57850cfd4c92a4f9231581dff7faac489566.zip
Add a quick test to $.support for native bind.
As per the suggestion by ajpiano: https://github.com/gf3/jquery/commit/9f8cd6c499844451468257140e71f611abb3a040#commitcomment-218658
-rw-r--r--src/core.js2
-rw-r--r--src/support.js3
2 files changed, 4 insertions, 1 deletions
diff --git a/src/core.js b/src/core.js
index 74ec4ea03..a6e2a46f8 100644
--- a/src/core.js
+++ b/src/core.js
@@ -751,7 +751,7 @@ jQuery.extend({
return undefined;
}
- if ( jQuery.isFunction( Function.prototype.bind ) ) {
+ if ( jQuery.support.nativeBind ) {
// Native bind
args = slice.call( arguments, 1 );
proxy = Function.prototype.bind.apply( fn, args );
diff --git a/src/support.js b/src/support.js
index 67b41c4a7..2913d2172 100644
--- a/src/support.js
+++ b/src/support.js
@@ -60,6 +60,9 @@
// (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
optSelected: opt.selected,
+ // Test for native Function#bind.
+ nativeBind: jQuery.isFunction( Function.prototype.bind ),
+
// Will be defined later
deleteExpando: true,
optDisabled: false,