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

Unified Diff: pkg/compiler/lib/src/js/rewrite_async.dart

Issue 902783008: The execution of an async* should only be scheduled when the stream is (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebase Created 5 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:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/compiler/lib/src/js_backend/backend.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/js/rewrite_async.dart
diff --git a/pkg/compiler/lib/src/js/rewrite_async.dart b/pkg/compiler/lib/src/js/rewrite_async.dart
index 54f5bbed9faf0883967d314b2f0dd8063c873457..1c5b49d89e8738a374cda3cf26b52ffa3fed7629 100644
--- a/pkg/compiler/lib/src/js/rewrite_async.dart
+++ b/pkg/compiler/lib/src/js/rewrite_async.dart
@@ -186,6 +186,11 @@ class AsyncRewriter extends js.NodeVisitor {
/// Specific to async* methods.
final js.Expression newController;
+ /// Used to get the `Stream` out of the [controllerName] variable.
+ ///
+ /// Specific to async* methods.
+ final js.Expression streamOfController;
+
/// Contructor creating the Iterable for a sync* method. Called with
/// [helperName].
final js.Expression newIterable;
@@ -232,6 +237,7 @@ class AsyncRewriter extends js.NodeVisitor {
spannable,
{this.thenHelper,
this.streamHelper,
+ this.streamOfController,
this.newCompleter,
this.newController,
this.endOfIteration,
@@ -589,8 +595,8 @@ class AsyncRewriter extends js.NodeVisitor {
});
} else if (isAsyncStar) {
return js.js.statement(
- "return #streamHelper(null, $helperName, $controllerName, null);", {
- "streamHelper": streamHelper
+ "return #streamOfController($controllerName);", {
+ "streamOfController": streamOfController
});
} else {
throw diagnosticListener.internalError(
« no previous file with comments | « no previous file | pkg/compiler/lib/src/js_backend/backend.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698