Chromium Code Reviews| Index: tools/dom/templates/html/impl/impl_XMLHttpRequest.darttemplate |
| diff --git a/tools/dom/templates/html/impl/impl_XMLHttpRequest.darttemplate b/tools/dom/templates/html/impl/impl_XMLHttpRequest.darttemplate |
| index 078d873b230c53637867d92323a520d0ae3bedda..8034447dfd326b13c440a38ea958042607c85a6e 100644 |
| --- a/tools/dom/templates/html/impl/impl_XMLHttpRequest.darttemplate |
| +++ b/tools/dom/templates/html/impl/impl_XMLHttpRequest.darttemplate |
| @@ -94,12 +94,14 @@ $(ANNOTATIONS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC { |
| 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 ) { |
|
Emily Fortuna
2013/02/07 20:53:44
This doesn't fix the problem described in dartbug.
|
| + completer.complete(xhr); |
| + } else { |
| + completer.completeError(e); |
| + } |
| } |
| }); |