Index: pkg/compiler/lib/src/elements/entities.dart |
diff --git a/pkg/compiler/lib/src/elements/entities.dart b/pkg/compiler/lib/src/elements/entities.dart |
index 1cc4d7fbd920bd73400cb3e72c3ee2c64fcf1e8d..4f9c99b1d588a8fc7b7b010c29f7423842968dc0 100644 |
--- a/pkg/compiler/lib/src/elements/entities.dart |
+++ b/pkg/compiler/lib/src/elements/entities.dart |
@@ -30,11 +30,21 @@ abstract class LibraryEntity extends Entity {} |
/// Currently only [ClassElement] but later also kernel based Dart classes |
/// and/or Dart-in-JS classes. |
abstract class ClassEntity extends Entity { |
+ /// If this is a normal class, the enclosing library for this class. If this |
+ /// is a closure class, the enclosing class of the closure for which it was |
+ /// created. |
+ LibraryEntity get library; |
+ |
+ /// `true` if a synthesized class for a closurized method or local function. |
Siggi Cherem (dart-lang)
2017/03/14 04:54:59
nit: if a => if this is a ?
Johnni Winther
2017/03/15 12:07:09
Done.
|
bool get isClosure; |
} |
abstract class TypeVariableEntity extends Entity { |
+ /// The class or generic method that declared this type variable. |
Entity get typeDeclaration; |
+ |
+ /// The index of this type variable in the type variables of its |
+ /// [typeDeclaration]. |
int get index; |
} |
@@ -44,16 +54,41 @@ abstract class TypeVariableEntity extends Entity { |
/// Currently only [MemberElement] but later also kernel based Dart members |
/// and/or Dart-in-JS properties. |
abstract class MemberEntity extends Entity { |
+ /// `true` if this is a member of a library. |
Siggi Cherem (dart-lang)
2017/03/14 04:54:59
(optional) I tend to use the form "Whether ..." in
Johnni Winther
2017/03/15 12:07:09
Done.
|
bool get isTopLevel; |
+ |
+ /// `true` if this is a static member of a class. |
bool get isStatic; |
+ |
+ /// `true` if this is an instance member of a class. |
bool get isInstanceMember; |
+ |
+ /// `true` if this is a constructor. |
bool get isConstructor; |
+ |
+ /// `true` if this is a field. |
bool get isField; |
+ |
+ /// `true` if this is a normal method (neither constructor, getter or setter) |
+ /// or operator method. |
bool get isFunction; |
+ |
+ /// `true` if this is a getter. |
bool get isGetter; |
+ |
+ /// `true` if this is a setter. |
bool get isSetter; |
+ |
+ /// `true` if this member is assignable, i.e. a non-final field. |
bool get isAssignable; |
+ |
+ /// The enclosing class if this is a constuctor, instance member or |
+ /// static member of a class. |
ClassEntity get enclosingClass; |
+ |
+ /// The enclosing library if this is a library member, other wise the |
Siggi Cherem (dart-lang)
2017/03/14 04:54:59
other wise => otherwise
Johnni Winther
2017/03/15 12:07:09
Done.
|
+ /// enclosing library of the [enclosingClass]. |
+ LibraryEntity get library; |
} |
/// Stripped down super interface for field like entities. |
@@ -66,7 +101,11 @@ abstract class FieldEntity extends MemberEntity {} |
/// |
/// Currently only [MethodElement] but later also kernel based Dart constructors |
/// and methods and/or Dart-in-JS function-like properties. |
-abstract class FunctionEntity extends MemberEntity {} |
+abstract class FunctionEntity extends MemberEntity { |
+ /// `true` if this function is external, i.e. the body is not defined in terms |
+ /// of Dart code. |
Siggi Cherem (dart-lang)
2017/03/14 04:54:59
... and it is marked with the 'external' modifier
Johnni Winther
2017/03/15 12:07:09
That should be only one way to define it. A JEleme
|
+ bool get isExternal; |
+} |
/// Stripped down super interface for constructor like entities. |
/// |
@@ -75,7 +114,10 @@ abstract class FunctionEntity extends MemberEntity {} |
// TODO(johnniwinther): Remove factory constructors from the set of |
// constructors. |
abstract class ConstructorEntity extends FunctionEntity { |
+ /// `true` if this is a generative constructor, possibly redirecting. |
bool get isGenerativeConstructor; |
+ |
+ /// `true` if this is a factory constructor, possibly redirecting. |
bool get isFactoryConstructor; |
} |