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

Unified Diff: sdk/lib/_internal/compiler/implementation/types/concrete_types_inferrer.dart

Issue 18034027: Handle do-while (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Sync to head, address comments. Created 7 years, 5 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/compiler/dart2js/cpa_inference_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/types/concrete_types_inferrer.dart
diff --git a/sdk/lib/_internal/compiler/implementation/types/concrete_types_inferrer.dart b/sdk/lib/_internal/compiler/implementation/types/concrete_types_inferrer.dart
index b519c8d9a9e6e0e59d86e7de555d7229306fcb52..3051f4cd3b065234fbb0c041babd9018b26eba7c 100644
--- a/sdk/lib/_internal/compiler/implementation/types/concrete_types_inferrer.dart
+++ b/sdk/lib/_internal/compiler/implementation/types/concrete_types_inferrer.dart
@@ -1677,7 +1677,16 @@ class TypeInferrerVisitor extends ResolvedVisitor<ConcreteType> {
}
ConcreteType visitDoWhile(DoWhile node) {
- inferrer.fail(node, 'not yet implemented');
+ analyze(node.body);
+ analyze(node.condition);
+ ConcreteTypesEnvironment oldEnvironment;
+ do {
+ oldEnvironment = environment;
+ analyze(node.body);
+ analyze(node.condition);
+ environment = oldEnvironment.join(environment);
+ } while (oldEnvironment != environment);
+ return inferrer.emptyConcreteType;
}
ConcreteType visitExpressionStatement(ExpressionStatement node) {
@@ -1690,7 +1699,6 @@ class TypeInferrerVisitor extends ResolvedVisitor<ConcreteType> {
analyze(node.initializer);
}
analyze(node.conditionStatement);
- ConcreteType result = inferrer.emptyConcreteType;
ConcreteTypesEnvironment oldEnvironment;
do {
oldEnvironment = environment;
@@ -1702,7 +1710,7 @@ class TypeInferrerVisitor extends ResolvedVisitor<ConcreteType> {
// value indicating whether something changed to avoid performing this
// comparison twice.
} while (oldEnvironment != environment);
- return result;
+ return inferrer.emptyConcreteType;
}
void analyzeClosure(FunctionExpression node) {
@@ -2001,7 +2009,6 @@ class TypeInferrerVisitor extends ResolvedVisitor<ConcreteType> {
ConcreteType visitWhile(While node) {
analyze(node.condition);
- ConcreteType result = inferrer.emptyConcreteType;
ConcreteTypesEnvironment oldEnvironment;
do {
oldEnvironment = environment;
@@ -2009,7 +2016,7 @@ class TypeInferrerVisitor extends ResolvedVisitor<ConcreteType> {
analyze(node.body);
environment = oldEnvironment.join(environment);
} while (oldEnvironment != environment);
- return result;
+ return inferrer.emptyConcreteType;
}
ConcreteType visitParenthesizedExpression(ParenthesizedExpression node) {
« no previous file with comments | « no previous file | tests/compiler/dart2js/cpa_inference_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698