File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed
Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff 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" ) ;
Original file line number Diff line number Diff line change @@ -137,7 +137,7 @@ test(".load()) - 404 error callbacks", function() {
137137} ) ;
138138
139139test ( "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
163166test ( "Ajax events with context" , function ( ) {
You can’t perform that action at this time.
0 commit comments