mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-22 09:30:28 +00:00
fix($browser.xhr): properly delete jsonp callbacks
This commit is contained in:
parent
4ab3596295
commit
c52e749a6e
2 changed files with 2 additions and 2 deletions
|
|
@ -92,7 +92,7 @@ function Browser(window, document, body, XHR, $log) {
|
|||
var script = jqLite(rawDocument.createElement('script'))
|
||||
.attr({type: 'text/javascript', src: url.replace('JSON_CALLBACK', callbackId)});
|
||||
window[callbackId] = function(data){
|
||||
window[callbackId] = undefined;
|
||||
delete window[callbackId];
|
||||
script.remove();
|
||||
completeOutstandingRequest(callback, 200, data);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ describe('browser', function(){
|
|||
fakeWindow[url[1]]('data');
|
||||
expect(callback).toHaveBeenCalled();
|
||||
expect(log).toEqual('remove();200:data;');
|
||||
expect(typeof fakeWindow[url[1]]).toEqual('undefined');
|
||||
expect(fakeWindow[url[1]]).toBeUndefined();
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue