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

Unified Diff: pkg/analyzer/test/src/task/dart_test.dart

Issue 1665353002: Use ElementAnnotation as the ConstantEvaluationTarget for annotations. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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/analyzer/test/generated/constant_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/src/task/dart_test.dart
diff --git a/pkg/analyzer/test/src/task/dart_test.dart b/pkg/analyzer/test/src/task/dart_test.dart
index 74e3ce5ccbcef912f5395ede292de70967fca69e..195735fe65c40f5e806004e60d00866a774690ee 100644
--- a/pkg/analyzer/test/src/task/dart_test.dart
+++ b/pkg/analyzer/test/src/task/dart_test.dart
@@ -185,8 +185,7 @@ f() {
unitElement.types[0].fields[0],
unitElement.functions[0].localVariables[0],
unitElement.types[0].constructors[0],
- new ConstantEvaluationTarget_Annotation(
- context, source, source, annotation),
+ annotation.elementAnnotation,
unitElement.types[0].constructors[0].parameters[0]
];
expect(
@@ -1141,10 +1140,7 @@ class D { const D(value); }
// Now compute the dependencies for the annotation, and check that it is
// the set [x, constructorForD].
// TODO(paulberry): test librarySource != source
- computeResult(
- new ConstantEvaluationTarget_Annotation(
- context, source, source, annotation),
- CONSTANT_DEPENDENCIES,
+ computeResult(annotation.elementAnnotation, CONSTANT_DEPENDENCIES,
matcher: isComputeConstantDependenciesTask);
expect(
outputs[CONSTANT_DEPENDENCIES].toSet(), [x, constructorForD].toSet());
@@ -1171,10 +1167,7 @@ const x = 1;
Annotation annotation = findClassAnnotation(unit, 'C');
// Now compute the dependencies for the annotation, and check that it is
// the list [x].
- computeResult(
- new ConstantEvaluationTarget_Annotation(
- context, source, source, annotation),
- CONSTANT_DEPENDENCIES,
+ computeResult(annotation.elementAnnotation, CONSTANT_DEPENDENCIES,
matcher: isComputeConstantDependenciesTask);
expect(outputs[CONSTANT_DEPENDENCIES], [x]);
}
@@ -1238,9 +1231,7 @@ class ComputeConstantValueTaskTest extends _AbstractDartTaskTest {
if (member is ClassDeclaration && member.name.name == className) {
expect(member.metadata, hasLength(1));
Annotation annotation = member.metadata[0];
- ConstantEvaluationTarget_Annotation target =
- new ConstantEvaluationTarget_Annotation(
- context, source, source, annotation);
+ ElementAnnotationImpl target = annotation.elementAnnotation;
computeResult(target, CONSTANT_VALUE,
matcher: isComputeConstantValueTask);
expect(outputs[CONSTANT_VALUE], same(target));
« no previous file with comments | « pkg/analyzer/test/generated/constant_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698