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

Unified Diff: lib/compiler/implementation/emitter.dart

Issue 10310040: Sort the output (for now just the classes and instance members). (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add test. Created 8 years, 7 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: lib/compiler/implementation/emitter.dart
diff --git a/lib/compiler/implementation/emitter.dart b/lib/compiler/implementation/emitter.dart
index dda702ae1b39e367d535a9e8d545d9378d995eb1..0b6b4ea5ac3c01c8f09fc0ea052501b6ee219005 100644
--- a/lib/compiler/implementation/emitter.dart
+++ b/lib/compiler/implementation/emitter.dart
@@ -487,7 +487,15 @@ function() {
neededClasses.add(superclass);
}
}
- for (ClassElement element in neededClasses) {
+ List<ClassElement> sortedClasses =
+ new List<ClassElement>.from(neededClasses);
+ sortedClasses.sort((ClassElement class1, ClassElement class2) {
+ // We sort by the ids of the classes. There is no guarantee that these
+ // ids are meaningful (or even deterministic), but in the current
+ // implementation they are increasing within a source file.
+ return class1.id - class2.id;
+ });
+ for (ClassElement element in sortedClasses) {
generateClass(element, buffer);
}
« no previous file with comments | « lib/compiler/implementation/elements/elements.dart ('k') | lib/compiler/implementation/scanner/class_element_parser.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698