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

Unified Diff: pkg/kernel/lib/transformations/continuation.dart

Issue 2782053003: Await cancellation in the Kernel await transformer (Closed)
Patch Set: Created 3 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 | « no previous file | tests/language/language_kernel.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/kernel/lib/transformations/continuation.dart
diff --git a/pkg/kernel/lib/transformations/continuation.dart b/pkg/kernel/lib/transformations/continuation.dart
index 7f593d17f4efd7aec1278a23b1a6ce42a8f85822..2ba5d0620bbfb81cc7c8ffc56da454bcce1a1f6e 100644
--- a/pkg/kernel/lib/transformations/continuation.dart
+++ b/pkg/kernel/lib/transformations/continuation.dart
@@ -554,7 +554,7 @@ abstract class AsyncRewriterBase extends ContinuationRewriterBase {
// ...
// }
// } finally {
- // :for-iterator.cancel();
+ // await :for-iterator.cancel();
// }
// }
var iteratorVariable = new VariableDeclaration(':for-iterator',
@@ -579,10 +579,9 @@ abstract class AsyncRewriterBase extends ContinuationRewriterBase {
var tryBody = new WhileStatement(condition, whileBody);
// iterator.cancel();
- var tryFinalizer = new ExpressionStatement(new MethodInvocation(
- new VariableGet(iteratorVariable),
- new Name('cancel'),
- new Arguments(<Expression>[])));
+ var tryFinalizer = new ExpressionStatement(new AwaitExpression(
+ new MethodInvocation(new VariableGet(iteratorVariable),
+ new Name('cancel'), new Arguments(<Expression>[]))));
var tryFinally = new TryFinally(tryBody, tryFinalizer);
« no previous file with comments | « no previous file | tests/language/language_kernel.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698