mirror of
https://github.com/jquery/jquery.git
synced 2026-04-20 03:01:22 -04:00
Make sure original context is maintained and not the deep extended one. Fixes #5924.
This commit is contained in:
@@ -180,6 +180,27 @@ test("Ajax events with context", function() {
|
||||
});
|
||||
});
|
||||
|
||||
test("jQuery.ajax context modification", function() {
|
||||
expect(1);
|
||||
|
||||
stop();
|
||||
|
||||
var obj = {}
|
||||
|
||||
jQuery.ajax({
|
||||
url: url("data/name.html"),
|
||||
context: obj,
|
||||
beforeSend: function(){
|
||||
this.test = "foo";
|
||||
},
|
||||
complete: function() {
|
||||
start();
|
||||
}
|
||||
});
|
||||
|
||||
equals( obj.test, "foo", "Make sure the original object is maintained." );
|
||||
});
|
||||
|
||||
test("jQuery.ajax() - disabled globals", function() {
|
||||
expect( 3 );
|
||||
stop();
|
||||
|
||||
Reference in New Issue
Block a user