From ed8240e23dc2c06e08c5bada2a22b15bb34d0264 Mon Sep 17 00:00:00 2001 From: Ben Lesh Date: Tue, 5 Jan 2016 13:29:33 -0800 Subject: [PATCH] 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 --- src/observable/dom/ajax.ts | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/observable/dom/ajax.ts b/src/observable/dom/ajax.ts index 364de7a84b..462fa10fe3 100644 --- a/src/observable/dom/ajax.ts +++ b/src/observable/dom/ajax.ts @@ -134,7 +134,6 @@ export class AjaxObservable extends Observable { xhr.onprogress = onProgress; } xhr.onerror = onError; - xhr.onabort = onAbort; } const contentType = headers['Content-Type'] || @@ -192,14 +191,6 @@ export class AjaxObservable extends Observable { 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);