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

Unified Diff: tests/compiler/dart2js/metadata_test.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
« no previous file with comments | « tests/compiler/dart2js/message_kind_helper.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/metadata_test.dart
diff --git a/tests/compiler/dart2js/metadata_test.dart b/tests/compiler/dart2js/metadata_test.dart
index 62e6fecbbacbe6cbdd48e7a7b0c3968a93fd168e..847f46906ef433411c49984b9aa2af89fab0d845 100644
--- a/tests/compiler/dart2js/metadata_test.dart
+++ b/tests/compiler/dart2js/metadata_test.dart
@@ -36,7 +36,8 @@ void checkAnnotation(String name, String declaration,
'Unexpected metadata count on $element.');
PartialMetadataAnnotation annotation = element.metadata.head;
annotation.ensureResolved(compiler);
- PrimitiveConstantValue value = annotation.constant.value;
+ PrimitiveConstantValue value =
+ compiler.constants.getConstantValue(annotation.constant);
Expect.stringEquals('xyz', value.primitiveValue.slowToString());
checkPosition(annotation, annotation.cachedNode, source1, compiler);
@@ -59,8 +60,10 @@ void checkAnnotation(String name, String declaration,
Expect.isFalse(identical(annotation1, annotation2),
'expected unique instances');
Expect.notEquals(annotation1, annotation2, 'expected unequal instances');
- PrimitiveConstantValue value1 = annotation1.constant.value;
- PrimitiveConstantValue value2 = annotation2.constant.value;
+ PrimitiveConstantValue value1 =
+ compiler.constants.getConstantValue(annotation1.constant);
+ PrimitiveConstantValue value2 =
+ compiler.constants.getConstantValue(annotation2.constant);
Expect.identical(value1, value2, 'expected same compile-time constant');
Expect.stringEquals('xyz', value1.primitiveValue.slowToString());
Expect.stringEquals('xyz', value2.primitiveValue.slowToString());
@@ -89,7 +92,8 @@ void checkAnnotation(String name, String declaration,
Expect.equals(1, length(element.metadata));
PartialMetadataAnnotation annotation = element.metadata.head;
annotation.ensureResolved(compiler);
- PrimitiveConstantValue value = annotation.constant.value;
+ PrimitiveConstantValue value =
+ compiler.constants.getConstantValue(annotation.constant);
Expect.stringEquals('xyz', value.primitiveValue.slowToString());
checkPosition(annotation, annotation.cachedNode, source3, compiler);
@@ -118,8 +122,10 @@ void checkAnnotation(String name, String declaration,
Expect.isFalse(identical(annotation1, annotation2),
'expected unique instances');
Expect.notEquals(annotation1, annotation2, 'expected unequal instances');
- PrimitiveConstantValue value1 = annotation1.constant.value;
- PrimitiveConstantValue value2 = annotation2.constant.value;
+ PrimitiveConstantValue value1 =
+ compiler.constants.getConstantValue(annotation1.constant);
+ PrimitiveConstantValue value2 =
+ compiler.constants.getConstantValue(annotation2.constant);
Expect.identical(value1, value2, 'expected same compile-time constant');
Expect.stringEquals('xyz', value1.primitiveValue.slowToString());
Expect.stringEquals('xyz', value2.primitiveValue.slowToString());
@@ -168,7 +174,8 @@ void testLibraryTags() {
PartialMetadataAnnotation annotation = metadata.head;
annotation.ensureResolved(compiler);
- PrimitiveConstantValue value = annotation.constant.value;
+ PrimitiveConstantValue value =
+ compiler.constants.getConstantValue(annotation.constant);
Expect.stringEquals('xyz', value.primitiveValue.slowToString());
checkPosition(annotation, annotation.cachedNode, source, compiler);
« no previous file with comments | « tests/compiler/dart2js/message_kind_helper.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698