Chromium Code Reviews| Index: pkg/compiler/lib/src/constants/expressions.dart |
| diff --git a/pkg/compiler/lib/src/constants/expressions.dart b/pkg/compiler/lib/src/constants/expressions.dart |
| index 0c6a6ac8795f0ace9761a22530c484b75f32e21f..13c799f8bb0a00b44e07e3d9e747f578a46cd8a2 100644 |
| --- a/pkg/compiler/lib/src/constants/expressions.dart |
| +++ b/pkg/compiler/lib/src/constants/expressions.dart |
| @@ -28,6 +28,7 @@ enum ConstantExpressionKind { |
| CONSTRUCTED, |
| DEFERRED, |
| DOUBLE, |
| + DUMMY, |
| ERRONEOUS, |
| FUNCTION, |
| IDENTICAL, |
| @@ -335,6 +336,34 @@ class ErroneousConstantExpression extends ConstantExpression { |
| bool _equals(ErroneousConstantExpression other) => true; |
| } |
| +class DummyConstantExpression extends ConstantExpression { |
|
Johnni Winther
2015/05/28 12:07:17
Add a TODO for me to see if we can avoid the need
herhut
2015/06/01 12:09:41
Done.
|
| + final DummyConstantValue value; |
| + |
| + DummyConstantExpression(this.value); |
| + |
| + @override |
| + ConstantValue evaluate(Environment environment, |
| + ConstantSystem constantSystem) { |
| + return value; |
| + } |
| + |
| + @override |
| + int _computeHashCode() => 13 * value.hashCode; |
| + |
| + accept(ConstantExpressionVisitor visitor, [context]) { |
| + throw "unsupported"; |
| + } |
| + |
| + @override |
| + bool _equals(BoolConstantExpression other) { |
| + return value == other.value; |
| + } |
| + |
| + ConstantExpressionKind get kind => ConstantExpressionKind.DUMMY; |
| +} |
| + |
| + |
| + |
| /// A boolean, int, double, string, or null constant. |
| abstract class PrimitiveConstantExpression extends ConstantExpression { |
| final PrimitiveConstantValue value; |