Just restore window.JSON in the getJSON test, don't try to delete the value.
[jquery.git] / test / unit / ajax.js
index 5d791be..d827a15 100644 (file)
@@ -74,7 +74,7 @@ test("Ajax events with context", function() {
        expect(6);
        
        stop();
-       var context = {};
+       var context = document.createElement("div");
        
        function event(e){
                equals( this, context, e.type );
@@ -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" );
 });
 
+/*
+ * 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() {
        expect(2);
 
@@ -389,6 +393,7 @@ test("global ajaxSettings", function() {
 
        jQuery.ajaxSettings = tmp;
 });
+*/
 
 test("load(String)", function() {
        expect(1);
@@ -780,12 +785,9 @@ test("jQuery.getJSON - Using Native JSON", function() {
 
        stop();
        jQuery.getJSON(url("data/json.php"), function(json) {
-               if (!old)
-                       delete window.JSON
-               else
-                       window.JSON = old;
-         equals( json, true, "Verifying return value" );
-         start();
+               window.JSON = old;
+               equals( json, true, "Verifying return value" );
+               start();
        });
 });