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

Unified Diff: sdk/lib/_internal/compiler/implementation/dart_backend/dart_codegen.dart

Issue 284213002: dart2dart: Logical operators and related rewrite rules in dart_tree. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Bugfix in iteration of tryCollapseIf Created 6 years, 7 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: sdk/lib/_internal/compiler/implementation/dart_backend/dart_codegen.dart
diff --git a/sdk/lib/_internal/compiler/implementation/dart_backend/dart_codegen.dart b/sdk/lib/_internal/compiler/implementation/dart_backend/dart_codegen.dart
index 6b4bc7a8f3ec5bf1267113f2b943f5bc05358be9..18f094da83938aa6209318e238df8320b28efbd7 100644
--- a/sdk/lib/_internal/compiler/implementation/dart_backend/dart_codegen.dart
+++ b/sdk/lib/_internal/compiler/implementation/dart_backend/dart_codegen.dart
@@ -263,6 +263,16 @@ class ASTEmitter extends tree.Visitor<dynamic, Expression> {
visitExpression(exp.elseExpression));
}
+ Expression visitLogicalOperator(tree.LogicalOperator exp) {
+ return new BinaryOperator(visitExpression(exp.left),
+ exp.operator,
+ visitExpression(exp.right));
+ }
+
+ Expression visitNot(tree.Not exp) {
+ return new UnaryOperator('!', visitExpression(exp.operand));
+ }
+
Expression visitVariable(tree.Variable exp) {
return new Identifier(exp.name)
..element = exp.element;

Powered by Google App Engine
This is Rietveld 408576698