jQuery.ajax modified the passed-in object only to help test the code - this shouldn't occur. Fixes #5439.

This commit is contained in:
John Resig 2009-11-07 16:08:07 +01:00
parent 1a94a46826
commit 6a722e251d
2 changed files with 6 additions and 1 deletions

View file

@ -194,7 +194,7 @@ jQuery.extend({
ajax: function( s ) { ajax: function( s ) {
// Extend the settings, but re-extend 's' so that it can be // Extend the settings, but re-extend 's' so that it can be
// checked again later (in the test suite, specifically) // checked again later (in the test suite, specifically)
s = jQuery.extend(true, s, jQuery.extend(true, {}, jQuery.ajaxSettings, s)); s = jQuery.extend(true, {}, jQuery.ajaxSettings, s);
var jsonp, status, data, var jsonp, status, data,
callbackContext = s.context || window, callbackContext = s.context || window,

View file

@ -368,6 +368,10 @@ test("ajax cache", function () {
ok( jQuery.ajax({url: "data/text.php?name=David&_=tobereplaced555&washere=true", cache:false}), "test with 2 parameters surrounding _= one" ); ok( jQuery.ajax({url: "data/text.php?name=David&_=tobereplaced555&washere=true", cache:false}), "test with 2 parameters surrounding _= one" );
}); });
/*
* Test disabled.
* The assertions expect that the passed-in object will be modified,
* which shouldn't be the case. Fixes #5439.
test("global ajaxSettings", function() { test("global ajaxSettings", function() {
expect(2); expect(2);
@ -389,6 +393,7 @@ test("global ajaxSettings", function() {
jQuery.ajaxSettings = tmp; jQuery.ajaxSettings = tmp;
}); });
*/
test("load(String)", function() { test("load(String)", function() {
expect(1); expect(1);