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

Unified Diff: pkg/compiler/lib/src/cps_ir/cps_ir_builder_visitor.dart

Issue 912293004: Let the CPS ir builder bail out when given a non-sync function. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Also giveup on nested async-functions, and update status files. 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 | tests/language/language_dart2js.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/cps_ir/cps_ir_builder_visitor.dart
diff --git a/pkg/compiler/lib/src/cps_ir/cps_ir_builder_visitor.dart b/pkg/compiler/lib/src/cps_ir/cps_ir_builder_visitor.dart
index e859eef61e5b502dd98b18e5233d2ae187b0d791..ea7bf3a1fe80c63bc88acd16a83908be7d0c4354 100644
--- a/pkg/compiler/lib/src/cps_ir/cps_ir_builder_visitor.dart
+++ b/pkg/compiler/lib/src/cps_ir/cps_ir_builder_visitor.dart
@@ -1035,6 +1035,9 @@ class DartCapturedVariables extends ast.Visitor
visitFunctionExpression(ast.FunctionExpression node) {
FunctionElement oldFunction = currentFunction;
currentFunction = elements[node];
+ if (currentFunction.asyncMarker != AsyncMarker.SYNC) {
+ giveup(node, "cannot handle async/sync*/async* functions");
+ }
if (node.initializers != null) {
insideInitializer = true;
visit(node.initializers);
@@ -1128,6 +1131,9 @@ class DartIrBuilderVisitor extends IrBuilderVisitor {
ir.FunctionDefinition buildFunction(FunctionElement element) {
assert(invariant(element, element.isImplementation));
ast.FunctionExpression node = element.node;
+ if (element.asyncMarker != AsyncMarker.SYNC) {
+ giveup(null, 'cannot handle async-await');
+ }
if (!element.isSynthesized) {
assert(node != null);
« no previous file with comments | « no previous file | tests/language/language_dart2js.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698