aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit
diff options
context:
space:
mode:
authorjaubourg <j@ubourg.net>2011-07-23 02:10:17 +0200
committerjaubourg <j@ubourg.net>2011-07-23 02:10:17 +0200
commite6a99fdb0ee9e0fd7552d5de8bc4acbe982e98b7 (patch)
tree9c321dfd3dc5e01837f58fef37a9102887d9a562 /test/unit
parent28b470d7d38c5c3d7d478f9c3f3b743bdae57b1b (diff)
downloadjquery-e6a99fdb0ee9e0fd7552d5de8bc4acbe982e98b7.tar.gz
jquery-e6a99fdb0ee9e0fd7552d5de8bc4acbe982e98b7.zip
Fixes #9887: ajax now supports circular references into objects passed as context. Prefilter and transport developpers should add their own custom option into flatOptions when needed. Unit test added.
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/ajax.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/unit/ajax.js b/test/unit/ajax.js
index 334339227..6af56db4f 100644
--- a/test/unit/ajax.js
+++ b/test/unit/ajax.js
@@ -2076,6 +2076,22 @@ test( "jQuery.ajax - Location object as url (#7531)", 1, function () {
ok( success, "document.location did not generate exception" );
});
+test( "jQuery.ajax - Context with circular references (#9887)", 2, function () {
+ var success = false,
+ context = {};
+ context.field = context;
+ try {
+ success = !jQuery.ajax( "non-existing", {
+ context: context,
+ beforeSend: function() {
+ ok( this === context, "context was not deep extended" );
+ return false;
+ }
+ });
+ } catch (e) { console.log( e ); }
+ ok( success, "context with circular reference did not generate an exception" );
+});
+
test( "jQuery.ajax - statusCode" , function() {
var count = 12;