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

Unified Diff: pkg/compiler/lib/src/js_backend/type_variable_handler.dart

Issue 1148343004: Remove ConstantExpression.value (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Update 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/type_variable_handler.dart
diff --git a/pkg/compiler/lib/src/js_backend/type_variable_handler.dart b/pkg/compiler/lib/src/js_backend/type_variable_handler.dart
index 26e38a93dfebd0f99f0c6b6361cdb304bfc083da..6b04672c84314832cd2b6b56a5d10676ff219661 100644
--- a/pkg/compiler/lib/src/js_backend/type_variable_handler.dart
+++ b/pkg/compiler/lib/src/js_backend/type_variable_handler.dart
@@ -72,27 +72,24 @@ class TypeVariableHandler {
for (TypeVariableType currentTypeVariable in cls.typeVariables) {
TypeVariableElement typeVariableElement = currentTypeVariable.element;
- AstConstant wrapConstant(ConstantExpression constant) {
- return new AstConstant(typeVariableElement,
- typeVariableElement.node,
- constant);
- }
-
- ConstantExpression name = new StringConstantExpression(
- currentTypeVariable.name,
+ AstConstant name = new AstConstant(
+ typeVariableElement,
+ typeVariableElement.node,
+ new StringConstantExpression(currentTypeVariable.name),
_backend.constantSystem.createString(
new DartString.literal(currentTypeVariable.name)));
int boundIndex = _metadataCollector.reifyType(typeVariableElement.bound);
- ConstantExpression bound = new IntConstantExpression(
- boundIndex,
+ AstConstant bound = new AstConstant(
+ typeVariableElement,
+ typeVariableElement.node,
+ new IntConstantExpression(boundIndex),
_backend.constantSystem.createInt(boundIndex));
- ConstantExpression type =
- new TypeConstantExpression(
- _backend.constantSystem.createType(
- _backend.compiler, cls.rawType),
- cls.rawType);
- List<AstConstant> arguments =
- [wrapConstant(type), wrapConstant(name), wrapConstant(bound)];
+ AstConstant type = new AstConstant(
+ typeVariableElement,
+ typeVariableElement.node,
+ new TypeConstantExpression(cls.rawType),
+ _backend.constantSystem.createType(_backend.compiler, cls.rawType));
+ List<AstConstant> arguments = [type, name, bound];
// TODO(johnniwinther): Support a less front-end specific creation of
// constructed constants.

Powered by Google App Engine
This is Rietveld 408576698