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

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

Issue 15026006: Support for extending native classes (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 4 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: sdk/lib/_internal/compiler/implementation/elements/elements.dart
diff --git a/sdk/lib/_internal/compiler/implementation/elements/elements.dart b/sdk/lib/_internal/compiler/implementation/elements/elements.dart
index 21d59200e09c98df1c5ca4f676b39aed4dc553db..b1a4d38552726ca47bde104b1e91169ee2d35588 100644
--- a/sdk/lib/_internal/compiler/implementation/elements/elements.dart
+++ b/sdk/lib/_internal/compiler/implementation/elements/elements.dart
@@ -332,6 +332,12 @@ class Elements {
&& (identical(element.kind, ElementKind.FUNCTION));
}
+ static bool isNativeOrExtendsNative(ClassElement element) {
+ if (element == null) return false;
+ if (element.isNative()) return true;
+ return isNativeOrExtendsNative(element.superclass);
+ }
+
static bool isInstanceSend(Send send, TreeElements elements) {
Element element = elements[send];
if (element == null) return !isClosureSend(send, element);
@@ -358,7 +364,7 @@ class Elements {
return new SourceString(reconstructConstructorName(element));
}
}
-
+
// TODO(johnniwinther): Remove this method.
static String reconstructConstructorName(Element element) {
String className = element.getEnclosingClass().name.slowToString();

Powered by Google App Engine
This is Rietveld 408576698