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

Unified Diff: pkg/analysis_server/lib/src/status/validator.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 | « no previous file | pkg/analyzer/lib/dart/element/element.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/src/status/validator.dart
diff --git a/pkg/analysis_server/lib/src/status/validator.dart b/pkg/analysis_server/lib/src/status/validator.dart
index 10dc8ac9c8054b764a5e57494e6f4cec8dd898f1..b153c292b62990fa6db1f7fdef2aa5077e509d38 100644
--- a/pkg/analysis_server/lib/src/status/validator.dart
+++ b/pkg/analysis_server/lib/src/status/validator.dart
@@ -24,6 +24,7 @@ import 'package:analyzer/src/task/html.dart';
import 'package:analyzer/task/dart.dart';
import 'package:analyzer/task/model.dart';
import 'package:html/dom.dart' as html;
+import 'package:analyzer/src/dart/element/element.dart';
/**
* A class used to compare two element models for equality.
@@ -1193,11 +1194,11 @@ class ValidationResults {
//
// Handle special cases.
//
- if (first is ConstantEvaluationTarget_Annotation &&
- second is ConstantEvaluationTarget_Annotation) {
+ if (first is ElementAnnotationImpl &&
+ second is ElementAnnotationImpl) {
return _equal(first.source, second.source) &&
_equal(first.librarySource, second.librarySource) &&
- _equal(first.annotation, second.annotation);
+ _equal(first.annotationAst, second.annotationAst);
} else if (first is AstNode && second is AstNode) {
return first.runtimeType == second.runtimeType &&
first.offset == second.offset &&
@@ -1216,7 +1217,7 @@ class ValidationResults {
//
// Handle special cases.
//
- if (object is ConstantEvaluationTarget_Annotation) {
+ if (object is ElementAnnotation) {
return object.source.hashCode;
} else if (object is AstNode) {
return object.offset;
@@ -1308,17 +1309,17 @@ class ValueComparison {
bool _compareConstantEvaluationTargets(ConstantEvaluationTarget expected,
ConstantEvaluationTarget actual, StringBuffer buffer) {
- if (actual is ConstantEvaluationTarget_Annotation) {
- ConstantEvaluationTarget_Annotation expectedAnnotation = expected;
- ConstantEvaluationTarget_Annotation actualAnnotation = actual;
+ if (actual is ElementAnnotation) {
+ ElementAnnotationImpl expectedAnnotation = expected;
+ ElementAnnotationImpl actualAnnotation = actual;
if (actualAnnotation.source == expectedAnnotation.source &&
actualAnnotation.librarySource == expectedAnnotation.librarySource &&
- actualAnnotation.annotation == expectedAnnotation.annotation) {
+ actualAnnotation.annotationAst == expectedAnnotation.annotationAst) {
return true;
}
if (buffer != null) {
- void write(ConstantEvaluationTarget_Annotation target) {
- Annotation annotation = target.annotation;
+ void write(ElementAnnotationImpl target) {
+ Annotation annotation = target.annotationAst;
buffer.write(annotation);
buffer.write(' at ');
buffer.write(annotation.offset);
« no previous file with comments | « no previous file | pkg/analyzer/lib/dart/element/element.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698