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

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: 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
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..dc28e677b97d5d9cb5764c095203f27a24506b14 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.
+ ///
+ /// Sepcific to async* methods.
floitsch 2015/02/10 13:27:50 Specific
sigurdm 2015/02/10 13:35:52 Done.
+ 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') | sdk/lib/_internal/compiler/js_lib/js_helper.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698