(type, event)
| 299 | } |
| 300 | }; |
| 301 | var onFinish = function (type, event) { |
| 302 | if (event == null || event.preventDefault == null) { |
| 303 | event = { |
| 304 | preventDefault: k |
| 305 | }; |
| 306 | } |
| 307 | // Firefox 52 fires "readystatechange" (xhr.readyState === 4) without final "readystatechange" (xhr.readyState === 3) |
| 308 | // IE 8 fires "onload" without "onprogress" |
| 309 | onProgress(); |
| 310 | if (state === 1 || state === 2 || state === 3) { |
| 311 | state = 4; |
| 312 | if (timeout !== 0) { |
| 313 | clearTimeout(timeout); |
| 314 | timeout = 0; |
| 315 | } |
| 316 | that.readyState = 4; |
| 317 | if (type === "load") { |
| 318 | that.onload(event); |
| 319 | } else if (type === "error") { |
| 320 | that.onerror(event); |
| 321 | } else if (type === "abort") { |
| 322 | that.onabort(event); |
| 323 | } else { |
| 324 | throw new TypeError(); |
| 325 | } |
| 326 | that.onreadystatechange(); |
| 327 | } |
| 328 | }; |
| 329 | var onReadyStateChange = function (event) { |
| 330 | if (xhr != undefined) { // Opera 12 |
| 331 | if (xhr.readyState === 4) { |
no test coverage detected