Skip to content
Permalink
Browse files
Uses a copy of the flags when they are given as an object rather than…
… the object itself. That way, we're sure flags are immutable for the entire lifetime of the Callbacks instance.
  • Loading branch information
jaubourg committed Apr 25, 2012
1 parent 54fab31 commit ad32938
Showing 1 changed file with 1 addition and 1 deletion.
@@ -40,7 +40,7 @@ jQuery.Callbacks = function( flags ) {

// Convert flags from String-formatted to Object-formatted if needed
// (we check in cache first)
flags = typeof flags === "string" ? ( flagsCache[ flags ] || createFlags( flags ) ) : ( flags || {} );
flags = typeof flags === "string" ? ( flagsCache[ flags ] || createFlags( flags ) ) : jQuery.extend( {}, flags );

var // Actual callback list
list = [],

0 comments on commit ad32938

Please sign in to comment.