X Tutup
Skip to content

Commit ad32938

Browse files
committed
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.
1 parent 54fab31 commit ad32938

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/callbacks.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jQuery.Callbacks = function( flags ) {
4040

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

4545
var // Actual callback list
4646
list = [],

0 commit comments

Comments
 (0)
X Tutup