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

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

Issue 1927963002: Support compilation of Hello World (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Fixes 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 | « pkg/compiler/lib/src/elements/common.dart ('k') | pkg/compiler/lib/src/elements/modelx.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/elements/elements.dart
diff --git a/pkg/compiler/lib/src/elements/elements.dart b/pkg/compiler/lib/src/elements/elements.dart
index a6683cf1b35018a35338e8b3227bc3602de00ea1..0216f562bad7ca5d9890368b7f1163ed73076d8d 100644
--- a/pkg/compiler/lib/src/elements/elements.dart
+++ b/pkg/compiler/lib/src/elements/elements.dart
@@ -329,6 +329,12 @@ abstract class Element implements Entity {
bool get impliesType;
+ /// The character offset of the declaration of this element within its
+ /// compilation unit, if available.
+ ///
+ /// This is used to sort the elements.
+ int get sourceOffset;
+
// TODO(johnniwinther): Remove this.
Token get position;
@@ -683,10 +689,8 @@ class Elements {
if (r != 0) return r;
r = a.compilationUnit.compareTo(b.compilationUnit);
if (r != 0) return r;
- Token positionA = a.position;
- Token positionB = b.position;
- int offsetA = positionA == null ? -1 : positionA.charOffset;
- int offsetB = positionB == null ? -1 : positionB.charOffset;
+ int offsetA = a.sourceOffset ?? -1;
+ int offsetB = b.sourceOffset ?? -1;
r = offsetA.compareTo(offsetB);
if (r != 0) return r;
r = a.name.compareTo(b.name);
@@ -1228,7 +1232,7 @@ abstract class ConstructorElement extends FunctionElement
/// The effective target of this constructor, that is the non-redirecting
/// constructor that is called on invocation of this constructor.
///
- /// Consider for instance this hierachy:
+ /// Consider for instance this hierarchy:
///
/// class C { factory C.c() = D.d; }
/// class D { factory D.d() = E.e2; }
@@ -1241,7 +1245,7 @@ abstract class ConstructorElement extends FunctionElement
/// The immediate redirection target of a redirecting factory constructor.
///
- /// Consider for instance this hierachy:
+ /// Consider for instance this hierarchy:
///
/// class C { factory C() = D; }
/// class D { factory D() = E; }
« no previous file with comments | « pkg/compiler/lib/src/elements/common.dart ('k') | pkg/compiler/lib/src/elements/modelx.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698