diff options
author | jaubourg <j@ubourg.net> | 2012-10-06 22:00:43 +0200 |
---|---|---|
committer | jaubourg <j@ubourg.net> | 2012-10-06 22:00:43 +0200 |
commit | bb38f706463a4d7598505b2f7adf3ed83935f298 (patch) | |
tree | de9074d730eadbe5bf71138aef2ccb3765e5d55c /src/callbacks.js | |
parent | cfe95a864330c45c2bf93ca4a89d84c01f5acff5 (diff) | |
download | jquery-bb38f706463a4d7598505b2f7adf3ed83935f298.tar.gz jquery-bb38f706463a4d7598505b2f7adf3ed83935f298.zip |
Do not iterate over functions. Fixes #12665. Unit tests added. Thanks to @kselden for finding the bug.
Diffstat (limited to 'src/callbacks.js')
-rw-r--r-- | src/callbacks.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/callbacks.js b/src/callbacks.js index 37acabcba..6fda47f00 100644 --- a/src/callbacks.js +++ b/src/callbacks.js @@ -93,8 +93,10 @@ jQuery.Callbacks = function( options ) { (function add( args ) { jQuery.each( args, function( _, arg ) { var type = jQuery.type( arg ); - if ( type === "function" && ( !options.unique || !self.has( arg ) ) ) { - list.push( arg ); + if ( type === "function" ) { + if ( !options.unique || !self.has( arg ) ) { + list.push( arg ); + } } else if ( arg && arg.length && type !== "string" ) { // Inspect recursively add( arg ); |