Remove XHR from pending JS on exception
parent
67ec08edea
commit
2aed85bb13
|
@ -98,15 +98,20 @@
|
||||||
var index = requestIndex++;
|
var index = requestIndex++;
|
||||||
var key = 'httprequest-' + index;
|
var key = 'httprequest-' + index;
|
||||||
|
|
||||||
// Add to the list of pending requests.
|
try {
|
||||||
addPending(key);
|
// Add to the list of pending requests.
|
||||||
|
addPending(key);
|
||||||
|
|
||||||
// Detect when it finishes and remove it from the list.
|
// Detect when it finishes and remove it from the list.
|
||||||
this.addEventListener('loadend', function() {
|
this.addEventListener('loadend', function() {
|
||||||
|
removePending(key);
|
||||||
|
});
|
||||||
|
|
||||||
|
return realOpen.apply(this, arguments);
|
||||||
|
} catch (e) {
|
||||||
removePending(key);
|
removePending(key);
|
||||||
});
|
throw e;
|
||||||
|
}
|
||||||
return realOpen.apply(this, arguments);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
var waitingBlocked = false;
|
var waitingBlocked = false;
|
||||||
|
|
Loading…
Reference in New Issue