Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(795)

Unified Diff: sky/framework/xmlhttprequest.sky

Issue 746953002: Move XMLHttpRequest#responseText to a getter (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/framework/xmlhttprequest.sky
diff --git a/sky/framework/xmlhttprequest.sky b/sky/framework/xmlhttprequest.sky
index 7018d084f2096e132d87cb441c94df0b7bc8089b..5b1090ad9fa1b89256656fba5cbbc30e941cd218 100644
--- a/sky/framework/xmlhttprequest.sky
+++ b/sky/framework/xmlhttprequest.sky
@@ -16,13 +16,13 @@ class Private {
this.request = null;
this.loader = null;
this.headers = new Map();
+ this.responseText = null;
esprehn 2014/11/21 08:08:28 default is empty string not null in the real one.
}
}
class XMLHttpRequest {
constructor() {
this[kPrivate] = new Private;
- this.responseText = null;
}
onload() {
@@ -31,6 +31,10 @@ class XMLHttpRequest {
onerror(error) {
}
+ get responseText() {
+ return this[kPrivate].responseText;
+ }
+
open(method, url) {
var request = new loader.URLRequest();
request.url = new URL(url, document.URL);
@@ -64,7 +68,7 @@ class XMLHttpRequest {
priv.loader.start(priv.request).then(function(result) {
return core.drainData(result.response.body).then(function(result) {
outstandingRequests.delete(self);
- self.responseText = unicode.decodeUtf8String(new Uint8Array(result.buffer));
+ priv.responseText = unicode.decodeUtf8String(new Uint8Array(result.buffer));
self.onload();
});
}).catch(function(error) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698