Index: pkg/compiler/lib/src/elements/modelx.dart |
diff --git a/pkg/compiler/lib/src/elements/modelx.dart b/pkg/compiler/lib/src/elements/modelx.dart |
index 3a1e981f5b85a870f330bb945e24f3e01b9ed29d..d090f760d872dfe274df4dbdeb8999e459e6fa0e 100644 |
--- a/pkg/compiler/lib/src/elements/modelx.dart |
+++ b/pkg/compiler/lib/src/elements/modelx.dart |
@@ -109,13 +109,15 @@ abstract class ElementX extends Element with ElementCommon { |
return enclosingElement != null && enclosingElement.isCompilationUnit; |
} |
+ @override |
+ int get sourceOffset => position?.charOffset; |
+ |
Token get position => null; |
SourceSpan get sourcePosition { |
if (position == null) return null; |
Uri uri = compilationUnit.script.resourceUri; |
- return new SourceSpan( |
- uri, position.charOffset, position.charOffset + position.charCount); |
+ return new SourceSpan(uri, position.charOffset, position.charEnd); |
} |
Token findMyName(Token token) { |
@@ -164,13 +166,6 @@ abstract class ElementX extends Element with ElementCommon { |
return null; |
} |
- Element get enclosingClassOrCompilationUnit { |
- for (Element e = this; e != null; e = e.enclosingElement) { |
- if (e.isClass || e.isCompilationUnit) return e; |
- } |
- return null; |
- } |
- |
/** |
* Creates the scope for this element. |
*/ |
@@ -2487,10 +2482,6 @@ abstract class BaseClassElementX extends ElementX |
bool isProxy = false; |
bool hasIncompleteHierarchy = false; |
- // backendMembers are members that have been added by the backend to simplify |
- // compilation. They don't have any user-side counter-part. |
- Link<Element> backendMembers = const Link<Element>(); |
- |
OrderedTypeSet allSupertypesAndSelf; |
BaseClassElementX(String name, Element enclosing, this.id, int initialState) |
@@ -2500,8 +2491,6 @@ abstract class BaseClassElementX extends ElementX |
int get hashCode => id; |
- bool get hasBackendMembers => !backendMembers.isEmpty; |
- |
bool get isUnnamedMixinApplication => false; |
@override |
@@ -2554,26 +2543,6 @@ abstract class BaseClassElementX extends ElementX |
void setDefaultConstructor( |
FunctionElement constructor, DiagnosticReporter reporter); |
- void addBackendMember(Element member) { |
- // TODO(ngeoffray): Deprecate this method. |
- assert(member.isGenerativeConstructorBody); |
- backendMembers = backendMembers.prepend(member); |
- } |
- |
- void reverseBackendMembers() { |
- backendMembers = backendMembers.reverse(); |
- } |
- |
- /// Lookup a synthetic element created by the backend. |
- Element lookupBackendMember(String memberName) { |
- for (Element element in backendMembers) { |
- if (element.name == memberName) { |
- return element; |
- } |
- } |
- return null; |
- } |
- |
ConstructorElement lookupDefaultConstructor() { |
ConstructorElement constructor = lookupConstructor(""); |
// This method might be called on constructors that have not been |
@@ -2598,10 +2567,6 @@ abstract class BaseClassElementX extends ElementX |
return supertype == null ? null : supertype.element; |
} |
- void forEachBackendMember(void f(Element member)) { |
- backendMembers.forEach(f); |
- } |
- |
// TODO(johnniwinther): Remove these when issue 18630 is fixed. |
ClassElement get patch => super.patch; |
ClassElement get origin => super.origin; |