Index: pkg/kernel/lib/transformations/closure/invalidate_closures.dart |
diff --git a/pkg/kernel/lib/transformations/closure/invalidate_closures.dart b/pkg/kernel/lib/transformations/closure/invalidate_closures.dart |
index 96e281e2b1990a992f4c53fb8f42f621aa00bd88..6cbbf76401ac70d983cf024b7c2cb72893ba36fb 100644 |
--- a/pkg/kernel/lib/transformations/closure/invalidate_closures.dart |
+++ b/pkg/kernel/lib/transformations/closure/invalidate_closures.dart |
@@ -18,6 +18,7 @@ class InvalidateClosures extends Transformer { |
} |
void invalidate(FunctionNode function) { |
+ if (function.asyncMarker != AsyncMarker.Sync) return; |
var position = function.location; |
function.body = new ExpressionStatement(new Throw( |
new StringLiteral("Calling unconverted closure at $position"))) |