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

Unified Diff: dart/pkg/compiler/lib/src/constants/expressions.dart

Issue 829033004: Non-fatal errors in compile-time constants. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Merged with r42767. Created 5 years, 11 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 | « dart/pkg/compiler/lib/src/compile_time_constants.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/pkg/compiler/lib/src/constants/expressions.dart
diff --git a/dart/pkg/compiler/lib/src/constants/expressions.dart b/dart/pkg/compiler/lib/src/constants/expressions.dart
index fe1357de51c8425d27e2e9c4a3141c263c3ddf08..ef416fac9ce86ef516bac949d816b61ebc1f5fc9 100644
--- a/dart/pkg/compiler/lib/src/constants/expressions.dart
+++ b/dart/pkg/compiler/lib/src/constants/expressions.dart
@@ -45,6 +45,17 @@ abstract class ConstantExpression {
}
}
+/// A synthetic constant used to recover from errors.
+class ErroneousConstantExpression extends ConstantExpression {
+ final PrimitiveConstantValue value = new NullConstantValue();
+
+ ErroneousConstantExpression();
+
+ accept(ConstantExpressionVisitor visitor, [context]) {
+ // Do nothing. This is an error.
+ }
+}
+
/// Boolean, int, double, string, or null constant.
class PrimitiveConstantExpression extends ConstantExpression {
final PrimitiveConstantValue value;
« no previous file with comments | « dart/pkg/compiler/lib/src/compile_time_constants.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698