Skip to content

Commit aa74396

Browse files
committed
Merge branch 'bug7422' of https://github.com/csnover/jquery into csnover-bug7422
2 parents fb48ae8 + e57b73a commit aa74396

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

src/ajax.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -463,10 +463,11 @@ jQuery.extend({
463463
try {
464464
var oldAbort = xhr.abort;
465465
xhr.abort = function() {
466-
// xhr.abort in IE7 is not a native JS function
467-
// and does not have a call property
468-
if ( xhr && oldAbort.call ) {
469-
oldAbort.call( xhr );
466+
if ( xhr ) {
467+
// oldAbort has no call property in IE7 so
468+
// just do it this way, which works in all
469+
// browsers
470+
Function.prototype.call.call( oldAbort, xhr );
470471
}
471472

472473
onreadystatechange( "abort" );

test/unit/ajax.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ test(".load()) - 404 error callbacks", function() {
137137
});
138138

139139
test("jQuery.ajax() - abort", function() {
140-
expect( 6 );
140+
expect( 8 );
141141
stop();
142142

143143
jQuery('#foo').ajaxStart(function(){
@@ -157,7 +157,10 @@ test("jQuery.ajax() - abort", function() {
157157
complete: function(){ ok(true, "complete"); }
158158
});
159159

160+
equals( xhr.readyState, 1, "XHR readyState indicates successful dispatch" );
161+
160162
xhr.abort();
163+
equals( xhr.readyState, 0, "XHR readyState indicates successful abortion" );
161164
});
162165

163166
test("Ajax events with context", function() {

0 commit comments

Comments
 (0)