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

Unified Diff: sdk/lib/html/dart2js/html_dart2js.dart

Issue 12224055: Converting XHR from onLoad to onReadyStateChange (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
Download patch
Index: sdk/lib/html/dart2js/html_dart2js.dart
diff --git a/sdk/lib/html/dart2js/html_dart2js.dart b/sdk/lib/html/dart2js/html_dart2js.dart
index e33d421417b5c54dbd7df861804c9c92101fb578..b398f6ba57bdbcb6af1c704838815e2227912517 100644
--- a/sdk/lib/html/dart2js/html_dart2js.dart
+++ b/sdk/lib/html/dart2js/html_dart2js.dart
@@ -12793,12 +12793,14 @@ class HttpRequest extends EventTarget native "*XMLHttpRequest" {
xhr.onProgress.listen(onProgress);
}
- xhr.onLoad.listen((e) {
- if (xhr.status >= 200 && xhr.status < 300 ||
- xhr.status == 304 ) {
- completer.complete(xhr);
- } else {
- completer.completeError(e);
+ xhr.onReadyStateChange.listen((e) {
+ if (xhr.readyState == HttpRequest.DONE) {
+ if (xhr.status >= 200 && xhr.status < 300 ||
+ xhr.status == 304 ) {
+ completer.complete(xhr);
+ } else {
+ completer.completeError(e);
+ }
}
});
« no previous file with comments | « no previous file | sdk/lib/html/dartium/html_dartium.dart » ('j') | tools/dom/templates/html/impl/impl_XMLHttpRequest.darttemplate » ('J')

Powered by Google App Engine
This is Rietveld 408576698