From: jaubourg Date: Wed, 25 Apr 2012 00:06:21 +0000 (+0200) Subject: Uses a copy of the flags when they are given as an object rather than the object... X-Git-Tag: 1.8b1~188 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=ad329384ff7ef449db12ca30650f6637a7fc17f7;p=jquery.git 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. --- 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 = [],