Make deep .extend() an optional argument - it will go deep if you pass in an boolean as the first argument (fixed bug #1028).

This commit is contained in:
John Resig 2007-08-21 04:42:31 +00:00
parent 8cf5d2df19
commit e112e6b04d
3 changed files with 11 additions and 5 deletions

View file

@ -434,7 +434,7 @@ jQuery.extend({
* @cat Ajax
*/
ajaxSetup: function( settings ) {
jQuery.extend( jQuery.ajaxSettings, settings );
jQuery.extend( true, jQuery.ajaxSettings, settings );
},
ajaxSettings: {
@ -575,7 +575,7 @@ jQuery.extend({
ajax: function( s ) {
// Extend the settings, but re-extend 's' so that it can be
// checked again later (in the test suite, specifically)
s = jQuery.extend(s, jQuery.extend({}, jQuery.ajaxSettings, s));
s = jQuery.extend(true, s, jQuery.extend(true, {}, jQuery.ajaxSettings, s));
// if data available
if ( s.data ) {