Skip to content

Commit

Permalink
Merge branch 'master' into local
Browse files Browse the repository at this point in the history
  • Loading branch information
gleneivey committed Oct 5, 2009
2 parents bd897bb + d81a2fe commit 1b5d4de
Show file tree
Hide file tree
Showing 3 changed files with 102 additions and 84 deletions.
62 changes: 34 additions & 28 deletions dist/env.js
Expand Up @@ -8569,6 +8569,7 @@ $debug("Initializing Window XMLHttpRequest.");
$w.XMLHttpRequest = function(){
this.headers = {};
this.responseHeaders = {};
this.$continueProcessing = true;
$debug("creating xhr");
};

Expand All @@ -8589,36 +8590,41 @@ XMLHttpRequest.prototype = {
var _this = this;

function makeRequest(){
$env.connection(_this, function(){
var responseXML = null;
_this.__defineGetter__("responseXML", function(){
if ( _this.responseText.match(/^\s*</) ) {
if(responseXML){
return responseXML;

}else{
try {
$debug("parsing response text into xml document");
responseXML = $domparser.parseFromString(_this.responseText+"");
return responseXML;
} catch(e) {
$error('response XML does not apear to be well formed xml', e);
responseXML = $domparser.parseFromString("<html>"+
"<head/><body><p> parse error </p></body></html>");
return responseXML;
$env.connection(_this, function(){
if (_this.$continueProcessing){
var responseXML = null;
_this.__defineGetter__("responseXML", function(){
if ( _this.responseText.match(/^\s*</) ) {
if(responseXML){
return responseXML;

}else{
try {
$debug("parsing response text into xml document");
responseXML = $domparser.parseFromString(_this.responseText+"");
return responseXML;
} catch(e) {
$error('response XML does not apear to be well formed xml', e);
responseXML = $domparser.parseFromString("<html>"+
"<head/><body><p> parse error </p></body></html>");
return responseXML;
}
}
}
}else{
$env.warn('response XML does not apear to be xml');
return null;
}
});
_this.__defineSetter__("responseXML",function(xml){
responseXML = xml;
});
}else{
$env.warn('response XML does not apear to be xml');
return null;
}
});
_this.__defineSetter__("responseXML",function(xml){
responseXML = xml;
});
}
}, data);
_this.onreadystatechange();

if (_this.$continueProcessing)
_this.onreadystatechange();
}

if (this.async){
$debug("XHR sending asynch;");
$env.runAsync(makeRequest);
Expand All @@ -8628,7 +8634,7 @@ XMLHttpRequest.prototype = {
}
},
abort: function(){
//TODO
this.$continueProcessing = false;
},
onreadystatechange: function(){
//TODO
Expand Down
62 changes: 34 additions & 28 deletions dist/env.rhino.js
Expand Up @@ -9226,6 +9226,7 @@ $debug("Initializing Window XMLHttpRequest.");
$w.XMLHttpRequest = function(){
this.headers = {};
this.responseHeaders = {};
this.$continueProcessing = true;
$debug("creating xhr");
};

Expand All @@ -9246,36 +9247,41 @@ XMLHttpRequest.prototype = {
var _this = this;

function makeRequest(){
$env.connection(_this, function(){
var responseXML = null;
_this.__defineGetter__("responseXML", function(){
if ( _this.responseText.match(/^\s*</) ) {
if(responseXML){
return responseXML;

}else{
try {
$debug("parsing response text into xml document");
responseXML = $domparser.parseFromString(_this.responseText+"");
return responseXML;
} catch(e) {
$error('response XML does not apear to be well formed xml', e);
responseXML = $domparser.parseFromString("<html>"+
"<head/><body><p> parse error </p></body></html>");
return responseXML;
$env.connection(_this, function(){
if (_this.$continueProcessing){
var responseXML = null;
_this.__defineGetter__("responseXML", function(){
if ( _this.responseText.match(/^\s*</) ) {
if(responseXML){
return responseXML;

}else{
try {
$debug("parsing response text into xml document");
responseXML = $domparser.parseFromString(_this.responseText+"");
return responseXML;
} catch(e) {
$error('response XML does not apear to be well formed xml', e);
responseXML = $domparser.parseFromString("<html>"+
"<head/><body><p> parse error </p></body></html>");
return responseXML;
}
}
}
}else{
$env.warn('response XML does not apear to be xml');
return null;
}
});
_this.__defineSetter__("responseXML",function(xml){
responseXML = xml;
});
}else{
$env.warn('response XML does not apear to be xml');
return null;
}
});
_this.__defineSetter__("responseXML",function(xml){
responseXML = xml;
});
}
}, data);
_this.onreadystatechange();

if (_this.$continueProcessing)
_this.onreadystatechange();
}

if (this.async){
$debug("XHR sending asynch;");
$env.runAsync(makeRequest);
Expand All @@ -9285,7 +9291,7 @@ XMLHttpRequest.prototype = {
}
},
abort: function(){
//TODO
this.$continueProcessing = false;
},
onreadystatechange: function(){
//TODO
Expand Down
62 changes: 34 additions & 28 deletions src/window/xhr.js
Expand Up @@ -7,6 +7,7 @@ $debug("Initializing Window XMLHttpRequest.");
$w.XMLHttpRequest = function(){
this.headers = {};
this.responseHeaders = {};
this.$continueProcessing = true;
$debug("creating xhr");
};

Expand All @@ -27,36 +28,41 @@ XMLHttpRequest.prototype = {
var _this = this;

function makeRequest(){
$env.connection(_this, function(){
var responseXML = null;
_this.__defineGetter__("responseXML", function(){
if ( _this.responseText.match(/^\s*</) ) {
if(responseXML){
return responseXML;

}else{
try {
$debug("parsing response text into xml document");
responseXML = $domparser.parseFromString(_this.responseText+"");
return responseXML;
} catch(e) {
$error('response XML does not apear to be well formed xml', e);
responseXML = $domparser.parseFromString("<html>"+
"<head/><body><p> parse error </p></body></html>");
return responseXML;
$env.connection(_this, function(){
if (_this.$continueProcessing){
var responseXML = null;
_this.__defineGetter__("responseXML", function(){
if ( _this.responseText.match(/^\s*</) ) {
if(responseXML){
return responseXML;

}else{
try {
$debug("parsing response text into xml document");
responseXML = $domparser.parseFromString(_this.responseText+"");
return responseXML;
} catch(e) {
$error('response XML does not apear to be well formed xml', e);
responseXML = $domparser.parseFromString("<html>"+
"<head/><body><p> parse error </p></body></html>");
return responseXML;
}
}
}
}else{
$env.warn('response XML does not apear to be xml');
return null;
}
});
_this.__defineSetter__("responseXML",function(xml){
responseXML = xml;
});
}else{
$env.warn('response XML does not apear to be xml');
return null;
}
});
_this.__defineSetter__("responseXML",function(xml){
responseXML = xml;
});
}
}, data);
_this.onreadystatechange();

if (_this.$continueProcessing)
_this.onreadystatechange();
}

if (this.async){
$debug("XHR sending asynch;");
$env.runAsync(makeRequest);
Expand All @@ -66,7 +72,7 @@ XMLHttpRequest.prototype = {
}
},
abort: function(){
//TODO
this.$continueProcessing = false;
},
onreadystatechange: function(){
//TODO
Expand Down

0 comments on commit 1b5d4de

Please sign in to comment.