diff options
author | jaubourg <j@ubourg.net> | 2012-04-25 02:06:21 +0200 |
---|---|---|
committer | jaubourg <j@ubourg.net> | 2012-04-25 02:06:21 +0200 |
commit | ad329384ff7ef449db12ca30650f6637a7fc17f7 (patch) | |
tree | c40f55b6ce15cde608e344355f230389bfec8fce | |
parent | 54fab3174c7844959b374e98b453c048b60de0d0 (diff) | |
download | jquery-ad329384ff7ef449db12ca30650f6637a7fc17f7.tar.gz jquery-ad329384ff7ef449db12ca30650f6637a7fc17f7.zip |
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.
-rw-r--r-- | src/callbacks.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/callbacks.js b/src/callbacks.js index 20422c35a..9e034cba0 100644 --- a/src/callbacks.js +++ b/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 = [], |