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:
slackersoft 2014-11-07 07:50:33 -08:00
parent 711764e290
commit a1c2859baf
2 changed files with 16 additions and 42 deletions

View File

@ -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) {
},

View File

@ -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) {
},