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

Unified Diff: pkg/analyzer2dart/lib/src/cps_generator.dart

Issue 693153002: Support is/as expressions in analyzer2dart. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 2 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/analyzer2dart/lib/src/tree_shaker.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer2dart/lib/src/cps_generator.dart
diff --git a/pkg/analyzer2dart/lib/src/cps_generator.dart b/pkg/analyzer2dart/lib/src/cps_generator.dart
index 60d2335c201499798b7af8265e46b176356cbcec..05df3b8f33495ea0f9f827ff2908d6acbf86d346 100644
--- a/pkg/analyzer2dart/lib/src/cps_generator.dart
+++ b/pkg/analyzer2dart/lib/src/cps_generator.dart
@@ -343,4 +343,21 @@ class CpsGeneratingVisitor extends SemanticVisitor<ir.Node>
irBuilder.buildWhile(buildCondition: subbuild(node.condition),
buildBody: subbuild(node.body));
}
+
+ @override
+ ir.Primitive visitIsExpression(IsExpression node) {
+ return irBuilder.buildTypeOperator(
+ visit(node.expression),
+ converter.convertType(node.type.type),
+ isTypeTest: true,
+ isNotCheck: node.notOperator != null);
+ }
+
+ @override
+ ir.Primitive visitAsExpression(AsExpression node) {
+ return irBuilder.buildTypeOperator(
+ visit(node.expression),
+ converter.convertType(node.type.type),
+ isTypeTest: false);
+ }
}
« no previous file with comments | « no previous file | pkg/analyzer2dart/lib/src/tree_shaker.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698