Skip to content

Commit ed8240e

Browse files
committed
fix(ajax): remove unnecessary onAbort handling
Since the xhr object is closed over, nothing external will be able to abort it. At best this code will be called and then swallowed because the Subscriber is already unsubscribed and will not allow the error to propogate through the Subscriber chain. It is basically cruft and can be removed
1 parent b046fd4 commit ed8240e

File tree

1 file changed

+0
-9
lines changed

1 file changed

+0
-9
lines changed

src/observable/dom/ajax.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,6 @@ export class AjaxObservable<T> extends Observable<T> {
134134
xhr.onprogress = onProgress;
135135
}
136136
xhr.onerror = onError;
137-
xhr.onabort = onAbort;
138137
}
139138

140139
const contentType = headers['Content-Type'] ||
@@ -192,14 +191,6 @@ export class AjaxObservable<T> extends Observable<T> {
192191
subscriber.error(normalizeError(e, xhr, 'error'));
193192
}
194193

195-
function onAbort(e) {
196-
done = true;
197-
if (progressSubscriber) {
198-
progressSubscriber.error(e);
199-
}
200-
subscriber.error(normalizeError(e, xhr, 'abort'));
201-
}
202-
203194
function onReadyStateChange(e) {
204195
if (xhr.readyState === 4) {
205196
processResponse(xhr, e);

0 commit comments

Comments
 (0)