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

Unified Diff: pkg/compiler/lib/src/js_emitter/metadata_collector.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_emitter/metadata_collector.dart
diff --git a/pkg/compiler/lib/src/js_emitter/metadata_collector.dart b/pkg/compiler/lib/src/js_emitter/metadata_collector.dart
index a2501fd668653c3e292171c825ec0934d74f2d3f..b2f1351fd9a55ba3574fc4e2725f3fcf0ce7bc75 100644
--- a/pkg/compiler/lib/src/js_emitter/metadata_collector.dart
+++ b/pkg/compiler/lib/src/js_emitter/metadata_collector.dart
@@ -49,12 +49,12 @@ class MetadataCollector {
if (link != null) {
for (; !link.isEmpty; link = link.tail) {
MetadataAnnotation annotation = link.head;
- ConstantExpression constant =
- _backend.constants.getConstantForMetadata(annotation);
+ ConstantValue constant =
+ _backend.constants.getConstantValueForMetadata(annotation);
if (constant == null) {
_compiler.internalError(annotation, 'Annotation value is null.');
} else {
- metadata.add(_emitter.constantReference(constant.value));
+ metadata.add(_emitter.constantReference(constant));
}
}
}
@@ -69,24 +69,24 @@ class MetadataCollector {
if (signature.optionalParameterCount == 0) return const [];
List<int> defaultValues = <int>[];
for (ParameterElement element in signature.optionalParameters) {
- ConstantExpression constant =
- _backend.constants.getConstantForVariable(element);
+ ConstantValue constant =
+ _backend.constants.getConstantValueForVariable(element);
jsAst.Expression expression = (constant == null)
? null
- : _emitter.constantReference(constant.value);
+ : _emitter.constantReference(constant);
defaultValues.add(addGlobalMetadata(expression));
}
return defaultValues;
}
int reifyMetadata(MetadataAnnotation annotation) {
- ConstantExpression constant =
- _backend.constants.getConstantForMetadata(annotation);
+ ConstantValue constant =
+ _backend.constants.getConstantValueForMetadata(annotation);
if (constant == null) {
_compiler.internalError(annotation, 'Annotation value is null.');
return -1;
}
- return addGlobalMetadata(_emitter.constantReference(constant.value));
+ return addGlobalMetadata(_emitter.constantReference(constant));
}
int reifyType(DartType type, {bool ignoreTypeVariables: false}) {

Powered by Google App Engine
This is Rietveld 408576698