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

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

Issue 10180001: Introduce typed selectors to do better tree shaking based on calls on 'this'. Getters and setters w… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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
Index: lib/compiler/implementation/elements/elements.dart
===================================================================
--- lib/compiler/implementation/elements/elements.dart (revision 6835)
+++ lib/compiler/implementation/elements/elements.dart (working copy)
@@ -846,6 +846,19 @@
return false;
}
+ /**
+ * Returns true if [cls] is a subclass of [this].
kasperl 2012/04/23 12:34:45 Shouldn't this be: if [this] is a subclass of [cls
ahe 2012/04/23 12:37:53 Good catch.
ngeoffray 2012/04/23 13:48:18 Done.
+ *
+ * This method is not to be used for checking type hierarchy and
floitsch 2012/04/23 13:58:30 Add explanation why, or contrast to it ("whereas a
ngeoffray 2012/04/23 14:09:33 Done.
+ * assignments.
+ */
+ bool isSubclassOf(ClassElement cls) {
+ for (ClassElement s = superclass; s != null; s = s.superclass) {
kasperl 2012/04/23 12:34:45 It is a bit surprising that you don't start at [th
ahe 2012/04/23 12:37:53 Good catch. I think this is a copy-and-paste erro
ngeoffray 2012/04/23 13:48:18 The method should start at this. Code fixed.
+ if (s === cls) return true;
+ }
+ return false;
+ }
+
bool isInterface() => false;
bool isNative() => nativeName != null;
SourceString nativeName;

Powered by Google App Engine
This is Rietveld 408576698