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

Unified Diff: sdk/lib/_internal/compiler/js_lib/js_helper.dart

Issue 1012623003: Fix problems with async* and await for in dart2js. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address review Created 5 years, 9 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:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/compiler/lib/src/ssa/builder.dart ('k') | tests/language/language_dart2js.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/js_lib/js_helper.dart
diff --git a/sdk/lib/_internal/compiler/js_lib/js_helper.dart b/sdk/lib/_internal/compiler/js_lib/js_helper.dart
index 92cae8e90fea146f7c6c6e5fe14bdc0d8e5873b9..6b2f2e8c8ca80128a3380fe26ed71e7aa93493d0 100644
--- a/sdk/lib/_internal/compiler/js_lib/js_helper.dart
+++ b/sdk/lib/_internal/compiler/js_lib/js_helper.dart
@@ -3752,7 +3752,7 @@ class AsyncStarStreamController {
Stream get stream => controller.stream;
bool stopRunning = false;
bool isAdding = false;
- bool get isPaused => controller.isPaused;
+ bool isPaused = false;
add(event) => controller.add(event);
addStream(Stream stream) {
return controller.addStream(stream, cancelOnError: false);
@@ -3769,12 +3769,16 @@ class AsyncStarStreamController {
wrapped(null);
});
},
- onResume: () {
+ onPause: () {
+ isPaused = true;
+ }, onResume: () {
+ isPaused = false;
if (!isAdding) {
asyncStarHelper(null, body, this);
}
}, onCancel: () {
stopRunning = true;
+ if (isPaused) asyncStarHelper(null, body, this);
});
}
}
« no previous file with comments | « pkg/compiler/lib/src/ssa/builder.dart ('k') | tests/language/language_dart2js.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698