Skip to content

Commit

Permalink
fix(ajax): remove unnecessary onAbort handling
Browse files Browse the repository at this point in the history
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
  • Loading branch information
benlesh committed Jan 13, 2016
1 parent b046fd4 commit ed8240e
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions src/observable/dom/ajax.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ export class AjaxObservable<T> extends Observable<T> {
xhr.onprogress = onProgress;
}
xhr.onerror = onError;
xhr.onabort = onAbort;
}

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

function onAbort(e) {
done = true;
if (progressSubscriber) {
progressSubscriber.error(e);
}
subscriber.error(normalizeError(e, xhr, 'abort'));
}

function onReadyStateChange(e) {
if (xhr.readyState === 4) {
processResponse(xhr, e);
Expand Down

0 comments on commit ed8240e

Please sign in to comment.