Start progress event callbacks off as null instead of empty functions.
- Apparently some libraries will null them out in certain circumstances, so make sure we handle it by default. Fix #85
This commit is contained in:
parent
711764e290
commit
a1c2859baf
@ -65,7 +65,7 @@ getJasmineRequireObj().AjaxFakeRequest = function() {
|
||||
|
||||
function wrapProgressEvent(xhr, eventName) {
|
||||
return function() {
|
||||
xhr[eventName]();
|
||||
xhr[eventName] && xhr[eventName]();
|
||||
};
|
||||
}
|
||||
|
||||
@ -176,26 +176,13 @@ getJasmineRequireObj().AjaxFakeRequest = function() {
|
||||
|
||||
readyState: 0,
|
||||
|
||||
onloadstart: function() {
|
||||
},
|
||||
|
||||
onprogress: function() {
|
||||
},
|
||||
|
||||
onabort: function() {
|
||||
},
|
||||
|
||||
onerror: function() {
|
||||
},
|
||||
|
||||
onload: function() {
|
||||
},
|
||||
|
||||
ontimeout: function() {
|
||||
},
|
||||
|
||||
onloadend: function() {
|
||||
},
|
||||
onloadstart: null,
|
||||
onprogress: null,
|
||||
onabort: null,
|
||||
onerror: null,
|
||||
onload: null,
|
||||
ontimeout: null,
|
||||
onloadend: null,
|
||||
|
||||
onreadystatechange: function(isTimeout) {
|
||||
},
|
||||
|
@ -20,7 +20,7 @@ getJasmineRequireObj().AjaxFakeRequest = function() {
|
||||
|
||||
function wrapProgressEvent(xhr, eventName) {
|
||||
return function() {
|
||||
xhr[eventName]();
|
||||
xhr[eventName] && xhr[eventName]();
|
||||
};
|
||||
}
|
||||
|
||||
@ -131,26 +131,13 @@ getJasmineRequireObj().AjaxFakeRequest = function() {
|
||||
|
||||
readyState: 0,
|
||||
|
||||
onloadstart: function() {
|
||||
},
|
||||
|
||||
onprogress: function() {
|
||||
},
|
||||
|
||||
onabort: function() {
|
||||
},
|
||||
|
||||
onerror: function() {
|
||||
},
|
||||
|
||||
onload: function() {
|
||||
},
|
||||
|
||||
ontimeout: function() {
|
||||
},
|
||||
|
||||
onloadend: function() {
|
||||
},
|
||||
onloadstart: null,
|
||||
onprogress: null,
|
||||
onabort: null,
|
||||
onerror: null,
|
||||
onload: null,
|
||||
ontimeout: null,
|
||||
onloadend: null,
|
||||
|
||||
onreadystatechange: function(isTimeout) {
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user