Commit ff951314 authored by Oleg's avatar Oleg

Remove old try...catch for old FF

parent c6de8210
...@@ -90,59 +90,49 @@ if ( xhrSupported ) { ...@@ -90,59 +90,49 @@ if ( xhrSupported ) {
callback = function( _, isAbort ) { callback = function( _, isAbort ) {
var status, statusText, responses; var status, statusText, responses;
// Firefox throws exceptions when accessing properties // Was never called and is aborted or complete
// of an xhr when a network error occurred if ( callback && ( isAbort || xhr.readyState === 4 ) ) {
// http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE) // Clean up
try { delete xhrCallbacks[ id ];
callback = undefined;
// Was never called and is aborted or complete xhr.onreadystatechange = jQuery.noop;
if ( callback && ( isAbort || xhr.readyState === 4 ) ) {
// Clean up // Abort manually if needed
delete xhrCallbacks[ id ]; if ( isAbort ) {
callback = undefined; if ( xhr.readyState !== 4 ) {
xhr.onreadystatechange = jQuery.noop; xhr.abort();
}
// Abort manually if needed } else {
if ( isAbort ) { responses = {};
if ( xhr.readyState !== 4 ) { status = xhr.status;
xhr.abort();
} // Support: IE<10
} else { // Accessing binary-data responseText throws an exception
responses = {}; // (#11426)
status = xhr.status; if ( typeof xhr.responseText === "string" ) {
responses.text = xhr.responseText;
// Support: IE<10 }
// Accessing binary-data responseText throws an exception
// (#11426) // Firefox throws an exception when accessing
if ( typeof xhr.responseText === "string" ) { // statusText for faulty cross-domain requests
responses.text = xhr.responseText; try {
} statusText = xhr.statusText;
} catch( e ) {
// Firefox throws an exception when accessing // We normalize with Webkit giving an empty statusText
// statusText for faulty cross-domain requests statusText = "";
try { }
statusText = xhr.statusText;
} catch( e ) { // Filter status for non standard behaviors
// We normalize with Webkit giving an empty statusText
statusText = ""; // If the request is local and we have data: assume a success
} // (success with no data won't get notified, that's the best we
// can do given current implementations)
// Filter status for non standard behaviors if ( !status && options.isLocal && !options.crossDomain ) {
status = responses.text ? 200 : 404;
// If the request is local and we have data: assume a success // IE - #1450: sometimes returns 1223 when it should be 204
// (success with no data won't get notified, that's the best we } else if ( status === 1223 ) {
// can do given current implementations) status = 204;
if ( !status && options.isLocal && !options.crossDomain ) {
status = responses.text ? 200 : 404;
// IE - #1450: sometimes returns 1223 when it should be 204
} else if ( status === 1223 ) {
status = 204;
}
} }
}
} catch( firefoxAccessException ) {
if ( !isAbort ) {
complete( -1, firefoxAccessException );
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment