Commit ad329384 authored by jaubourg's avatar jaubourg

Uses a copy of the flags when they are given as an object rather than the...

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.
parent 54fab317
...@@ -40,7 +40,7 @@ jQuery.Callbacks = function( flags ) { ...@@ -40,7 +40,7 @@ jQuery.Callbacks = function( flags ) {
// Convert flags from String-formatted to Object-formatted if needed // Convert flags from String-formatted to Object-formatted if needed
// (we check in cache first) // (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 var // Actual callback list
list = [], list = [],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment