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

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
« no previous file with comments | « lib/compiler/implementation/compile_time_constants.dart ('k') | lib/compiler/implementation/emitter.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,20 @@
return false;
}
+ /**
+ * Returns true if [this] is a subclass of [cls].
+ *
+ * This method is not to be used for checking type hierarchy and
+ * assignments, because it does not take parameterized types into
+ * account.
+ */
+ bool isSubclassOf(ClassElement cls) {
+ for (ClassElement s = this; s != null; s = s.superclass) {
+ if (s === cls) return true;
+ }
+ return false;
+ }
+
bool isInterface() => false;
bool isNative() => nativeName != null;
SourceString nativeName;
« no previous file with comments | « lib/compiler/implementation/compile_time_constants.dart ('k') | lib/compiler/implementation/emitter.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698