The code for handling Ajax timeouts was broken (the abort was being called too early). Fixing this allows the test suite to work again.

This commit is contained in:
John Resig 2008-11-18 04:53:34 +00:00
parent ab551c2b14
commit d81dfbcccf

View file

@ -393,11 +393,12 @@ jQuery.extend({
setTimeout(function(){ setTimeout(function(){
// Check to see if the request is still happening // Check to see if the request is still happening
if ( xhr ) { if ( xhr ) {
// Cancel the request
xhr.abort();
if( !requestDone ) if( !requestDone )
onreadystatechange( "timeout" ); onreadystatechange( "timeout" );
// Cancel the request
if ( xhr )
xhr.abort();
} }
}, s.timeout); }, s.timeout);
} }