| Index: pkg/compiler/lib/src/compile_time_constants.dart
|
| diff --git a/pkg/compiler/lib/src/compile_time_constants.dart b/pkg/compiler/lib/src/compile_time_constants.dart
|
| index 40a1bffa1ce654f49c4ce0d9424c9143d36b5a30..c5462dbff1a5d13d93a11d81fd01b8fe0ebd52ca 100644
|
| --- a/pkg/compiler/lib/src/compile_time_constants.dart
|
| +++ b/pkg/compiler/lib/src/compile_time_constants.dart
|
| @@ -159,7 +159,7 @@ abstract class ConstantCompilerBase implements ConstantCompiler {
|
| ConstantExpression value;
|
| if (initializer == null) {
|
| // No initial value.
|
| - value = new PrimitiveConstantExpression(new NullConstantValue());
|
| + value = new NullConstantExpression(new NullConstantValue());
|
| } else {
|
| value = compileNodeWithDefinitions(
|
| initializer, definitions, isConst: isConst);
|
| @@ -301,19 +301,22 @@ class CompileTimeConstantEvaluator extends Visitor<AstConstant> {
|
|
|
| AstConstant visitLiteralBool(LiteralBool node) {
|
| return new AstConstant(
|
| - context, node, new PrimitiveConstantExpression(
|
| + context, node, new BoolConstantExpression(
|
| + node.value,
|
| constantSystem.createBool(node.value)));
|
| }
|
|
|
| AstConstant visitLiteralDouble(LiteralDouble node) {
|
| return new AstConstant(
|
| - context, node, new PrimitiveConstantExpression(
|
| + context, node, new DoubleConstantExpression(
|
| + node.value,
|
| constantSystem.createDouble(node.value)));
|
| }
|
|
|
| AstConstant visitLiteralInt(LiteralInt node) {
|
| return new AstConstant(
|
| - context, node, new PrimitiveConstantExpression(
|
| + context, node, new IntConstantExpression(
|
| + node.value,
|
| constantSystem.createInt(node.value)));
|
| }
|
|
|
| @@ -382,13 +385,14 @@ class CompileTimeConstantEvaluator extends Visitor<AstConstant> {
|
|
|
| AstConstant visitLiteralNull(LiteralNull node) {
|
| return new AstConstant(
|
| - context, node, new PrimitiveConstantExpression(
|
| + context, node, new NullConstantExpression(
|
| constantSystem.createNull()));
|
| }
|
|
|
| AstConstant visitLiteralString(LiteralString node) {
|
| return new AstConstant(
|
| - context, node, new PrimitiveConstantExpression(
|
| + context, node, new StringConstantExpression(
|
| + node.dartString.slowToString(),
|
| constantSystem.createString(node.dartString)));
|
| }
|
|
|
| @@ -454,8 +458,9 @@ class CompileTimeConstantEvaluator extends Visitor<AstConstant> {
|
| String text = node.slowNameString;
|
| List<AstConstant> arguments =
|
| <AstConstant>[new AstConstant(context, node,
|
| - new PrimitiveConstantExpression(constantSystem.createString(
|
| - new DartString.literal(text))))];
|
| + new StringConstantExpression(
|
| + text,
|
| + constantSystem.createString(new LiteralDartString(text))))];
|
| AstConstant constant = makeConstructedConstant(
|
| compiler, handler, context, node, type, compiler.symbolConstructor,
|
| CallStructure.ONE_ARG,
|
| @@ -896,7 +901,7 @@ class CompileTimeConstantEvaluator extends Visitor<AstConstant> {
|
| error(node, message);
|
|
|
| return new AstConstant(
|
| - null, node, new PrimitiveConstantExpression(new NullConstantValue()));
|
| + null, node, new NullConstantExpression(new NullConstantValue()));
|
| }
|
| // Else we don't need to do anything. The final handler is only
|
| // optimistically trying to compile constants. So it is normal that we
|
|
|