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

Unified Diff: pkg/compiler/lib/src/elements/modelx.dart

Issue 1192103002: Support serialization of the compiler backbone. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments Created 5 years, 6 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
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 cf96f4e3ebefd2be3fa6bc5641a039a4e4864a40..09f1c82745873917d622e01505cc9f1f32bd777c 100644
--- a/pkg/compiler/lib/src/elements/modelx.dart
+++ b/pkg/compiler/lib/src/elements/modelx.dart
@@ -651,6 +651,7 @@ class ScopeX {
}
class CompilationUnitElementX extends ElementX
+ with CompilationUnitElementCommon
implements CompilationUnitElement {
final Script script;
PartOf partTag;
@@ -717,11 +718,6 @@ class CompilationUnitElementX extends ElementX
bool get hasMembers => !localMembers.isEmpty;
- int compareTo(CompilationUnitElement other) {
- if (this == other) return 0;
- return '${script.readableUri}'.compareTo('${other.script.readableUri}');
- }
-
Element get analyzableElement => library;
accept(ElementVisitor visitor, arg) {
@@ -1069,24 +1065,6 @@ class LibraryElementX
return libraryTag.name.toString();
}
- /**
- * Returns the library name (as defined by the library tag) or for script
- * (which have no library tag) the script file name. The latter case is used
- * to private 'library name' for scripts to use for instance in dartdoc.
- *
- * Note: the returned filename will still be escaped ("a%20b.dart" instead of
- * "a b.dart").
- */
- String getLibraryOrScriptName() {
- if (libraryTag != null) {
- return libraryTag.name.toString();
- } else {
- // Use the file name as script name.
- String path = canonicalUri.path;
- return path.substring(path.lastIndexOf('/') + 1);
- }
- }
-
Scope buildScope() => new LibraryScope(this);
String toString() {
@@ -1099,11 +1077,6 @@ class LibraryElementX
}
}
- int compareTo(LibraryElement other) {
- if (this == other) return 0;
- return getLibraryOrScriptName().compareTo(other.getLibraryOrScriptName());
- }
-
accept(ElementVisitor visitor, arg) {
return visitor.visitLibraryElement(this, arg);
}
@@ -2174,7 +2147,7 @@ class SynthesizedConstructorElementX extends ConstructorElementX {
}
accept(ElementVisitor visitor, arg) {
- return visitor.visitFunctionElement(this, arg);
+ return visitor.visitConstructorElement(this, arg);
}
}
@@ -2255,12 +2228,12 @@ abstract class TypeDeclarationElementX<T extends GenericType>
// Create types and elements for type variable.
Link<Node> nodes = parameters.nodes;
List<DartType> arguments =
- new List.generate(nodes.slowLength(), (_) {
+ new List.generate(nodes.slowLength(), (int index) {
TypeVariable node = nodes.head;
String variableName = node.name.source;
nodes = nodes.tail;
TypeVariableElementX variableElement =
- new TypeVariableElementX(variableName, this, node);
+ new TypeVariableElementX(variableName, this, index, node);
TypeVariableType variableType = new TypeVariableType(variableElement);
variableElement.typeCache = variableType;
return variableType;
@@ -2740,11 +2713,15 @@ class JumpTargetX implements JumpTarget {
class TypeVariableElementX extends ElementX with AstElementMixin
implements TypeVariableElement {
+ final int index;
final Node node;
TypeVariableType typeCache;
DartType boundCache;
- TypeVariableElementX(String name, TypeDeclarationElement enclosing, this.node)
+ TypeVariableElementX(String name,
+ TypeDeclarationElement enclosing,
+ this.index,
+ this.node)
: super(name, ElementKind.TYPE_VARIABLE, enclosing);
TypeDeclarationElement get typeDeclaration => enclosingElement;

Powered by Google App Engine
This is Rietveld 408576698