mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
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.
This commit is contained in:
parent
54fab3174c
commit
ad329384ff
@ -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 = [],
|
||||
|
Loading…
Reference in New Issue
Block a user