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

Unified Diff: pkg/compiler/lib/src/js_backend/constant_system_javascript.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
Index: pkg/compiler/lib/src/js_backend/constant_system_javascript.dart
diff --git a/pkg/compiler/lib/src/js_backend/constant_system_javascript.dart b/pkg/compiler/lib/src/js_backend/constant_system_javascript.dart
index fc97cadc60b7ff121ba9edcd4fbb0b0469f24c42..214c4803a7f3ddf3ace267faa50f5b37e240da75 100644
--- a/pkg/compiler/lib/src/js_backend/constant_system_javascript.dart
+++ b/pkg/compiler/lib/src/js_backend/constant_system_javascript.dart
@@ -240,8 +240,11 @@ class JavaScriptConstantSystem extends ConstantSystem {
return constant;
}
- NumConstantValue createInt(int i)
- => convertToJavaScriptConstant(new IntConstantValue(i));
+ @override
+ NumConstantValue createInt(int i) {
+ return convertToJavaScriptConstant(new IntConstantValue(i));
+ }
+
NumConstantValue createInt32(int i) => new IntConstantValue(i & BITS32);
NumConstantValue createDouble(double d)
=> convertToJavaScriptConstant(new DoubleConstantValue(d));
@@ -251,6 +254,19 @@ class JavaScriptConstantSystem extends ConstantSystem {
BoolConstantValue createBool(bool value) => new BoolConstantValue(value);
NullConstantValue createNull() => new NullConstantValue();
+
+ @override
+ ListConstantValue createList(InterfaceType type,
+ List<ConstantValue> values) {
+ return new ListConstantValue(type, values);
+ }
+
+ @override
+ ConstantValue createType(Compiler compiler, DartType type) {
+ return new TypeConstantValue(
+ type, compiler.backend.typeImplementation.computeType(compiler));
+ }
+
// Integer checks don't verify that the number is not -0.0.
bool isInt(ConstantValue constant) => constant.isInt || constant.isMinusZero;
bool isDouble(ConstantValue constant)

Powered by Google App Engine
This is Rietveld 408576698