Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit c52e749

Browse files
committed
fix($browser.xhr): properly delete jsonp callbacks
1 parent 4ab3596 commit c52e749

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Browser.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ function Browser(window, document, body, XHR, $log) {
9292
var script = jqLite(rawDocument.createElement('script'))
9393
.attr({type: 'text/javascript', src: url.replace('JSON_CALLBACK', callbackId)});
9494
window[callbackId] = function(data){
95-
window[callbackId] = undefined;
95+
delete window[callbackId];
9696
script.remove();
9797
completeOutstandingRequest(callback, 200, data);
9898
};

test/BrowserSpecs.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ describe('browser', function(){
9696
fakeWindow[url[1]]('data');
9797
expect(callback).toHaveBeenCalled();
9898
expect(log).toEqual('remove();200:data;');
99-
expect(typeof fakeWindow[url[1]]).toEqual('undefined');
99+
expect(fakeWindow[url[1]]).toBeUndefined();
100100
});
101101
});
102102

0 commit comments

Comments
 (0)