1 Sys.Net.XMLHttpExecutor = function Sys$Net$XMLHttpExecutor() {
3 if (arguments.length !== 0) throw Error.parameterCount();
4 Sys.Net.XMLHttpExecutor.initializeBase(this);
5 var _this = this;
6 this._xmlHttpRequest = null;
7 this._webRequest = null;
8 this._responseAvailable = false;
9 this._timedOut = false;
10 this._timer = null;
11 this._aborted = false;
12 this._started = false;
13 this._onReadyStateChange = function this$_onReadyStateChange() {
14
15 if (_this._xmlHttpRequest.readyState === 4 ) {
16 try {
17 if (typeof(_this._xmlHttpRequest.status) === "undefined") {
18 return;
19 }
20 }
21 catch(ex) {
22 return;
23 }
24
25 _this._clearTimer();
26 _this._responseAvailable = true;
27 _this._webRequest.completed(Sys.EventArgs.Empty);
28 if (_this._xmlHttpRequest != null) {
29 _this._xmlHttpRequest.onreadystatechange = Function.emptyMethod;
30 _this._xmlHttpRequest = null;
31 }
32 }
33 }
34 this._clearTimer = function this$_clearTimer() {
35 if (_this._timer != null) {
36 window.clearTimeout(_this._timer);
37 _this._timer = null;
38 }
39 }
40 this._onTimeout = function this$_onTimeout() {
41 if (!_this._responseAvailable) {
42 _this._clearTimer();
43 _this._timedOut = true;
44 _this._xmlHttpRequest.onreadystatechange = Function.emptyMethod;
45 _this._xmlHttpRequest.abort();
46 _this._webRequest.completed(Sys.EventArgs.Empty);
47 _this._xmlHttpRequest = null;
48 }
49 }
50 }