aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/callbacks.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/callbacks.js b/src/callbacks.js
index 387868604..20422c35a 100644
--- a/src/callbacks.js
+++ b/src/callbacks.js
@@ -38,9 +38,9 @@ function createFlags( flags ) {
*/
jQuery.Callbacks = function( flags ) {
- // Convert flags from String-formatted to Object-formatted
+ // Convert flags from String-formatted to Object-formatted if needed
// (we check in cache first)
- flags = flags ? ( flagsCache[ flags ] || createFlags( flags ) ) : {};
+ flags = typeof flags === "string" ? ( flagsCache[ flags ] || createFlags( flags ) ) : ( flags || {} );
var // Actual callback list
list = [],