From ad329384ff7ef449db12ca30650f6637a7fc17f7 Mon Sep 17 00:00:00 2001 From: jaubourg Date: Wed, 25 Apr 2012 02:06:21 +0200 Subject: [PATCH] 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. --- src/callbacks.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 = [],