asked on
// Name: MicrosoftAjax.debug.js
// Assembly: System.Web.Extensions
// Version: 3.5.0.0
// FileVersion: 3.5.30729.196
//-----------------------------------------------------------------------
// Copyright (C) Microsoft Corporation. All rights reserved.
//-----------------------------------------------------------------------
// MicrosoftAjax.js
// Microsoft AJAX Framework.
//other code removed to keep this short
Sys.Net.XMLHttpExecutor = function Sys$Net$XMLHttpExecutor() {
/// <summary locid="M:J#Sys.Net.XMLHttpExecutor.#ctor" />
if (arguments.length !== 0) throw Error.parameterCount();
Sys.Net.XMLHttpExecutor.initializeBase(this);
var _this = this;
this._xmlHttpRequest = null;
this._webRequest = null;
this._responseAvailable = false;
this._timedOut = false;
this._timer = null;
this._aborted = false;
this._started = false;
this._onReadyStateChange = (function () {
if (_this._xmlHttpRequest.readyState === 4 ) {
try {
if (typeof(_this._xmlHttpRequest.status) === "undefined") {
return;
}
}
catch(ex) {
return;
}
_this._clearTimer();
_this._responseAvailable = true;
try {
_this._webRequest.completed(Sys.EventArgs.Empty);
}
finally {
if (_this._xmlHttpRequest != null) {
_this._xmlHttpRequest.onreadystatechange = Function.emptyMethod;
_this._xmlHttpRequest = null;
}
}
}
});
this._clearTimer = (function() {
if (_this._timer != null) {
window.clearTimeout(_this._timer);
_this._timer = null;
}
});
this._onTimeout = (function() {
if (!_this._responseAvailable) {
_this._clearTimer();
_this._timedOut = true;
_this._xmlHttpRequest.onreadystatechange = Function.emptyMethod;
_this._xmlHttpRequest.abort();
_this._webRequest.completed(Sys.EventArgs.Empty);
_this._xmlHttpRequest = null;
}
});
}