| Index: pkg/compiler/lib/src/elements/common.dart
|
| diff --git a/pkg/compiler/lib/src/elements/common.dart b/pkg/compiler/lib/src/elements/common.dart
|
| index 8c8c4ffb2085b2f01d3a44f7b7c70e91a9c2a8b5..f9013c609ff3ce620794df46253f7c35bcf7aa7b 100644
|
| --- a/pkg/compiler/lib/src/elements/common.dart
|
| +++ b/pkg/compiler/lib/src/elements/common.dart
|
| @@ -126,6 +126,28 @@ abstract class LibraryElementCommon implements LibraryElement {
|
| @override
|
| bool get isInternalLibrary =>
|
| isPlatformLibrary && canonicalUri.path.startsWith('_');
|
| +
|
| + String getLibraryOrScriptName() {
|
| + if (hasLibraryName()) {
|
| + return getLibraryName();
|
| + } else {
|
| + // Use the file name as script name.
|
| + String path = canonicalUri.path;
|
| + return path.substring(path.lastIndexOf('/') + 1);
|
| + }
|
| + }
|
| +
|
| + int compareTo(LibraryElement other) {
|
| + if (this == other) return 0;
|
| + return getLibraryOrScriptName().compareTo(other.getLibraryOrScriptName());
|
| + }
|
| +}
|
| +
|
| +abstract class CompilationUnitElementCommon implements CompilationUnitElement {
|
| + int compareTo(CompilationUnitElement other) {
|
| + if (this == other) return 0;
|
| + return '${script.readableUri}'.compareTo('${other.script.readableUri}');
|
| + }
|
| }
|
|
|
| abstract class ClassElementCommon implements ClassElement {
|
|
|