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

Unified Diff: pkg/compiler/lib/src/constant_system_dart.dart

Issue 1121233002: Add ConstantExpression.evaluate. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments Created 5 years, 7 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 | « pkg/compiler/lib/src/compiler.dart ('k') | pkg/compiler/lib/src/constants/constant_system.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/constant_system_dart.dart
diff --git a/pkg/compiler/lib/src/constant_system_dart.dart b/pkg/compiler/lib/src/constant_system_dart.dart
index a827d59b1ae033fba71eeb22fac5fcb6958d978c..bcbfd307410bfe4e25b71fe7e1f5168c3146e5eb 100644
--- a/pkg/compiler/lib/src/constant_system_dart.dart
+++ b/pkg/compiler/lib/src/constant_system_dart.dart
@@ -394,13 +394,31 @@ class DartConstantSystem extends ConstantSystem {
const DartConstantSystem();
+
+ @override
IntConstantValue createInt(int i) => new IntConstantValue(i);
+
+ @override
DoubleConstantValue createDouble(double d) => new DoubleConstantValue(d);
+
+ @override
StringConstantValue createString(DartString string) {
return new StringConstantValue(string);
}
+
+ @override
BoolConstantValue createBool(bool value) => new BoolConstantValue(value);
+
+ @override
NullConstantValue createNull() => new NullConstantValue();
+
+ @override
+ ListConstantValue createList(InterfaceType type,
+ List<ConstantValue> values) {
+ return new ListConstantValue(type, values);
+ }
+
+ @override
MapConstantValue createMap(Compiler compiler,
InterfaceType type,
List<ConstantValue> keys,
@@ -408,6 +426,11 @@ class DartConstantSystem extends ConstantSystem {
return new MapConstantValue(type, keys, values);
}
+ @override
+ ConstantValue createType(Compiler compiler, DartType type) {
+ return new TypeConstantValue(type, compiler.coreTypes.typeType);
+ }
+
bool isInt(ConstantValue constant) => constant.isInt;
bool isDouble(ConstantValue constant) => constant.isDouble;
bool isString(ConstantValue constant) => constant.isString;
« no previous file with comments | « pkg/compiler/lib/src/compiler.dart ('k') | pkg/compiler/lib/src/constants/constant_system.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698