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

Unified Diff: compiler/java/com/google/dart/compiler/resolver/CompileTimeConstantAnalyzer.java

Issue 11421216: More co19 clean up. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years 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 | compiler/javatests/com/google/dart/compiler/resolver/CompileTimeConstantTest.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: compiler/java/com/google/dart/compiler/resolver/CompileTimeConstantAnalyzer.java
diff --git a/compiler/java/com/google/dart/compiler/resolver/CompileTimeConstantAnalyzer.java b/compiler/java/com/google/dart/compiler/resolver/CompileTimeConstantAnalyzer.java
index 433f8f940a298497ed042cea1745a2018ebd6dea..f0dc599147742f5e557a13f3b3f4d7eff4ae25f8 100644
--- a/compiler/java/com/google/dart/compiler/resolver/CompileTimeConstantAnalyzer.java
+++ b/compiler/java/com/google/dart/compiler/resolver/CompileTimeConstantAnalyzer.java
@@ -15,6 +15,7 @@ import com.google.dart.compiler.ast.DartBinaryExpression;
import com.google.dart.compiler.ast.DartBooleanLiteral;
import com.google.dart.compiler.ast.DartCase;
import com.google.dart.compiler.ast.DartClass;
+import com.google.dart.compiler.ast.DartConditional;
import com.google.dart.compiler.ast.DartDeclaration;
import com.google.dart.compiler.ast.DartDoubleLiteral;
import com.google.dart.compiler.ast.DartExpression;
@@ -279,9 +280,8 @@ public class CompileTimeConstantAnalyzer {
checkMathExpression(x, lhs, rhs, lhsType, rhsType);
break;
case TRUNC:
- reportExceptionIfZeroLiteral(x, rhs);
- // pass-through
case MOD:
+ reportExceptionIfZeroLiteral(x, rhs);
if (checkNumber(lhs, lhsType) && checkNumber(rhs, rhsType)) {
rememberInferredType(x, intType);
}
@@ -340,6 +340,12 @@ public class CompileTimeConstantAnalyzer {
rememberInferredType(x, doubleType);
return null;
}
+
+ @Override
+ public Void visitConditional(DartConditional node) {
+ expectedConstant(node);
+ return null;
+ }
@Override
public Void visitField(DartField x) {
« no previous file with comments | « no previous file | compiler/javatests/com/google/dart/compiler/resolver/CompileTimeConstantTest.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698