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

Unified Diff: pkg/analyzer/lib/src/summary/link.dart

Issue 1887213002: Add PropertyAccessorElementForLink_Variable.library getter. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 8 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/test/src/summary/linker_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/summary/link.dart
diff --git a/pkg/analyzer/lib/src/summary/link.dart b/pkg/analyzer/lib/src/summary/link.dart
index 8d7d33ed206c6a37fd2f83e9f27f0cd8ac2f4bae..f8e995df90e09dc0c891f7dcef542cfc9de067a8 100644
--- a/pkg/analyzer/lib/src/summary/link.dart
+++ b/pkg/analyzer/lib/src/summary/link.dart
@@ -535,6 +535,9 @@ class ClassElementForLink_Class extends ClassElementForLink
}
}
+ @override
+ String toString() => '$enclosingElement.$name';
+
/**
* Convert [typeRef] into an [InterfaceType].
*/
@@ -627,6 +630,9 @@ class ClassElementForLink_Enum extends ClassElementForLink {
@override
void link(CompilationUnitElementInBuildUnit compilationUnit) {}
+
+ @override
+ String toString() => '$enclosingElement.$name';
}
/**
@@ -647,7 +653,6 @@ abstract class CompilationUnitElementForLink implements CompilationUnitElement {
final List<ReferenceableElementForLink> _references;
List<ClassElementForLink_Class> _types;
-
Map<String, ReferenceableElementForLink> _containedNames;
List<TopLevelVariableElementForLink> _topLevelVariables;
List<ClassElementForLink_Enum> _enums;
@@ -761,6 +766,9 @@ abstract class CompilationUnitElementForLink implements CompilationUnitElement {
@override
noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
+ @override
+ String toString() => enclosingElement.toString();
+
/**
* Return the element referred to by the given [index] in
* [UnlinkedUnit.references]. If the reference is unresolved,
@@ -2329,6 +2337,9 @@ class FieldElementForLink_ClassField extends VariableElementForLink
}
}
}
+
+ @override
+ String toString() => '$enclosingElement.$name';
}
/**
@@ -2385,6 +2396,9 @@ class FieldElementForLink_EnumField extends FieldElementForLink
@override
noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
+
+ @override
+ String toString() => '$enclosingElement.$name';
}
/**
@@ -2684,6 +2698,9 @@ abstract class LibraryElementForLink<
@override
noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
+ @override
+ String toString() => _absoluteUri.toString();
+
/**
* Return the [LibraryElement] corresponding to the given dependency [index].
*/
@@ -3220,6 +3237,9 @@ class PropertyAccessorElementForLink_Executable extends ExecutableElementForLink
@override
noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
+
+ @override
+ String toString() => '$enclosingElement.$name';
}
/**
@@ -3252,6 +3272,10 @@ class PropertyAccessorElementForLink_Variable
ElementKind get kind => isSetter ? ElementKind.SETTER : ElementKind.GETTER;
@override
+ LibraryElementForLink get library =>
+ _variable.compilationUnit.enclosingElement;
+
+ @override
String get name => isSetter ? '${_variable.name}=' : _variable.name;
@override
@@ -3289,6 +3313,9 @@ class PropertyAccessorElementForLink_Variable
@override
noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
+
+ @override
+ String toString() => '$enclosingElement.$name';
}
/**
« no previous file with comments | « no previous file | pkg/analyzer/test/src/summary/linker_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698