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

Unified Diff: pkg/kernel/lib/class_hierarchy.dart

Issue 2924713002: Replace ClassHierarchy.classes with getOrderedClasses(). (Closed)
Patch Set: Tweak the comment. Created 3 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
« no previous file with comments | « no previous file | pkg/kernel/lib/src/incremental_class_hierarchy.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/kernel/lib/class_hierarchy.dart
diff --git a/pkg/kernel/lib/class_hierarchy.dart b/pkg/kernel/lib/class_hierarchy.dart
index 34bf1277580f7850ec2fec6bacaf9d30a210d904..7fddd6394f152a6e5fa71629c876040e33e677bc 100644
--- a/pkg/kernel/lib/class_hierarchy.dart
+++ b/pkg/kernel/lib/class_hierarchy.dart
@@ -16,12 +16,14 @@ abstract class ClassHierarchy {
factory ClassHierarchy(Program program) =>
new ClosedWorldClassHierarchy(program);
- /// All classes in the program.
+ /// Given the [unordered] classes, return them in such order that classes
+ /// occur after their super classes.
///
- /// The iterable is ordered so that classes occur after their super classes.
- Iterable<Class> get classes;
+ /// If [unordered] does not include all superclasses, they might still be
+ /// returned, it is up to the client to filter them out if required.
+ Iterable<Class> getOrderedClasses(Iterable<Class> unordered);
- /// Returns the index of [class_] in the [classes] list.
+ /// Returns the unique index of the [class_].
int getClassIndex(Class class_);
/// True if the program contains another class that is a subtype of given one.
@@ -137,6 +139,9 @@ class ClosedWorldClassHierarchy implements ClassHierarchy {
@override
int getClassIndex(Class class_) => _infoFor[class_].topologicalIndex;
+ @override
+ Iterable<Class> getOrderedClasses(Iterable<Class> unordered) => classes;
Siggi Cherem (dart-lang) 2017/06/06 00:15:21 mmm - It seems a bit surprising if you pass 2 clas
scheglov 2017/06/06 01:33:27 I updated `getOrderedClasses` to perform filtering
Siggi Cherem (dart-lang) 2017/06/06 03:03:44 sorry, makes sense, I forgot that IncrementalCla
+
/// True if [subclass] inherits from [superclass] though zero or more
/// `extends` relationships.
bool isSubclassOf(Class subclass, Class superclass) {
« no previous file with comments | « no previous file | pkg/kernel/lib/src/incremental_class_hierarchy.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698