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 ad329384ff7ef449db12ca30650f6637a7fc17f7
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/callbacks.js
@@ -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.
You can’t perform that action at this time.