aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit/ajax.js
diff options
context:
space:
mode:
authorColin Snover <github.com@zetafleet.com>2010-11-17 00:59:24 -0600
committerColin Snover <github.com@zetafleet.com>2010-11-17 00:59:24 -0600
commit2a0c7d702b83a6b2e40eb79a5d6ea94d74f3090d (patch)
tree42bb3ac925fa39198b24a051ee75e0e2d31ee2ff /test/unit/ajax.js
parent0838bdf52cf9f27ebc2bbee74fd7170e2d854c11 (diff)
downloadjquery-2a0c7d702b83a6b2e40eb79a5d6ea94d74f3090d.tar.gz
jquery-2a0c7d702b83a6b2e40eb79a5d6ea94d74f3090d.zip
Coerce s.url to string before calling replace, since replace is also a method of a Location object. Fixes #7531.
Diffstat (limited to 'test/unit/ajax.js')
-rw-r--r--test/unit/ajax.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/unit/ajax.js b/test/unit/ajax.js
index 4ce14c24c..b0c399b30 100644
--- a/test/unit/ajax.js
+++ b/test/unit/ajax.js
@@ -1350,6 +1350,16 @@ test("jQuery.ajax - active counter", function() {
ok( jQuery.active == 0, "ajax active counter should be zero: " + jQuery.active );
});
+test( "jQuery.ajax - Location object as url (#7531)", 1, function () {
+ var success = false;
+ try {
+ var xhr = jQuery.ajax({ url: document.location });
+ success = true;
+ xhr.abort();
+ } catch (e) {}
+
+ ok( success, "document.location did not generate exception" );
+});
}