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

Unified Diff: frog/leg/compile_time_constants.dart

Issue 9810027: Allow constant folding of && and ||. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comment. Created 8 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 | frog/leg/operations.dart » ('j') | frog/leg/operations.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: frog/leg/compile_time_constants.dart
diff --git a/frog/leg/compile_time_constants.dart b/frog/leg/compile_time_constants.dart
index 7fdfbbe43a1d29006a9f103e5b20e8b30f79f90e..e98234103a9045de9651a2c03e908d4172b13e48 100644
--- a/frog/leg/compile_time_constants.dart
+++ b/frog/leg/compile_time_constants.dart
@@ -878,6 +878,12 @@ class CompileTimeConstantEvaluator extends AbstractVisitor {
case "^":
folded = const BitXorOperation().fold(left, right);
break;
+ case "||":
+ folded = const BooleanOr().fold(left, right);
+ break;
+ case "&&":
+ folded = const BooleanAnd().fold(left, right);
+ break;
case "<<":
folded = const ShiftLeftOperation().fold(left, right);
break;
« no previous file with comments | « no previous file | frog/leg/operations.dart » ('j') | frog/leg/operations.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698