| Index: sdk/lib/_internal/compiler/implementation/elements/modelx.dart
|
| diff --git a/sdk/lib/_internal/compiler/implementation/elements/modelx.dart b/sdk/lib/_internal/compiler/implementation/elements/modelx.dart
|
| index 03224a3d8cc781a45d228d63854b02fd2770ed87..6edff50a3914da8e1a46c1f4a90ea96b28a8b2ff 100644
|
| --- a/sdk/lib/_internal/compiler/implementation/elements/modelx.dart
|
| +++ b/sdk/lib/_internal/compiler/implementation/elements/modelx.dart
|
| @@ -61,7 +61,7 @@ abstract class ElementX extends Element {
|
| return null;
|
| }
|
|
|
| - void addMetadata(MetadataAnnotation annotation) {
|
| + void addMetadata(MetadataAnnotationX annotation) {
|
| assert(annotation.annotatedElement == null);
|
| annotation.annotatedElement = this;
|
| addMetadataInternal(annotation);
|
| @@ -202,6 +202,9 @@ abstract class ElementX extends Element {
|
|
|
| Element get outermostEnclosingMemberOrTopLevel {
|
| // TODO(lrn): Why is this called "Outermost"?
|
| + // TODO(johnniwinther): Clean up this method: This method does not return
|
| + // the outermost for elements in closure classses, but some call-sites rely
|
| + // on that behavior.
|
| for (Element e = this; e != null; e = e.enclosingElement) {
|
| if (e.isMember || e.isTopLevel) {
|
| return e;
|
| @@ -262,7 +265,9 @@ abstract class ElementX extends Element {
|
|
|
| void diagnose(Element context, DiagnosticListener listener) {}
|
|
|
| - TreeElements get treeElements => enclosingElement.treeElements;
|
| + TreeElements get treeElements => analyzableElement.treeElements;
|
| +
|
| + AnalyzableElement get analyzableElement => outermostEnclosingMemberOrTopLevel;
|
| }
|
|
|
| /**
|
| @@ -543,7 +548,7 @@ class ScopeX {
|
| }
|
| }
|
|
|
| -class CompilationUnitElementX extends ElementX with AnalyzableElement
|
| +class CompilationUnitElementX extends ElementX
|
| implements CompilationUnitElement {
|
| final Script script;
|
| PartOf partTag;
|
| @@ -612,6 +617,8 @@ class CompilationUnitElementX extends ElementX with AnalyzableElement
|
| return '${script.readableUri}'.compareTo('${other.script.readableUri}');
|
| }
|
|
|
| + Element get analyzableElement => library;
|
| +
|
| accept(ElementVisitor visitor) => visitor.visitCompilationUnitElement(this);
|
| }
|
|
|
| @@ -723,7 +730,7 @@ class ImportScope {
|
| }
|
|
|
| class LibraryElementX
|
| - extends ElementX with AnalyzableElement, PatchMixin<LibraryElementX>
|
| + extends ElementX with AnalyzableElementX, PatchMixin<LibraryElementX>
|
| implements LibraryElement {
|
| final Uri canonicalUri;
|
| CompilationUnitElement entryCompilationUnit;
|
| @@ -774,6 +781,8 @@ class LibraryElementX
|
|
|
| CompilationUnitElement get compilationUnit => entryCompilationUnit;
|
|
|
| + Element get analyzableElement => this;
|
| +
|
| void addCompilationUnit(CompilationUnitElement element) {
|
| compilationUnits = compilationUnits.prepend(element);
|
| }
|
| @@ -1008,7 +1017,7 @@ class PrefixElementX extends ElementX implements PrefixElement {
|
| }
|
|
|
| class TypedefElementX extends ElementX
|
| - with AnalyzableElement, TypeDeclarationElementX<TypedefType>
|
| + with AnalyzableElementX, TypeDeclarationElementX<TypedefType>
|
| implements TypedefElement {
|
| Typedef cachedNode;
|
|
|
| @@ -1091,7 +1100,7 @@ class VariableList {
|
| DartType computeType(Element element, Compiler compiler) => type;
|
| }
|
|
|
| -class VariableElementX extends ElementX with AnalyzableElement
|
| +class VariableElementX extends ElementX with AnalyzableElementX
|
| implements VariableElement {
|
| final Token token;
|
| final VariableList variables;
|
| @@ -1447,7 +1456,7 @@ class FunctionSignatureX implements FunctionSignature {
|
| }
|
|
|
| abstract class FunctionElementX
|
| - extends ElementX with AnalyzableElement, PatchMixin<FunctionElement>
|
| + extends ElementX with AnalyzableElementX, PatchMixin<FunctionElement>
|
| implements FunctionElement {
|
| DartType typeCache;
|
| final Modifiers modifiers;
|
| @@ -1812,7 +1821,7 @@ abstract class TypeDeclarationElementX<T extends GenericType>
|
| }
|
|
|
| abstract class BaseClassElementX extends ElementX
|
| - with AnalyzableElement,
|
| + with AnalyzableElementX,
|
| TypeDeclarationElementX<InterfaceType>,
|
| PatchMixin<ClassElement>,
|
| ClassMemberMixin
|
|
|