| Index: lib/compiler/implementation/elements/elements.dart
|
| diff --git a/lib/compiler/implementation/elements/elements.dart b/lib/compiler/implementation/elements/elements.dart
|
| index efcb392b6ce5ccdfb44854c83c9ba2e17ecad2f3..b5af3d84ea693cdea65f54c30d71c0b4c07c2e59 100644
|
| --- a/lib/compiler/implementation/elements/elements.dart
|
| +++ b/lib/compiler/implementation/elements/elements.dart
|
| @@ -156,6 +156,16 @@ class Element implements Spannable {
|
| return enclosingElement != null && enclosingElement.isClass();
|
| }
|
| bool isInstanceMember() => false;
|
| +
|
| + /**
|
| + * Returns [:true:] if this element is enclosed in a static member or is
|
| + * itself a static member.
|
| + */
|
| + bool isInStaticMember() {
|
| + Element member = getEnclosingMember();
|
| + return member != null && member.modifiers.isStatic();
|
| + }
|
| +
|
| bool isFactoryConstructor() => modifiers.isFactory();
|
| bool isGenerativeConstructor() =>
|
| identical(kind, ElementKind.GENERATIVE_CONSTRUCTOR);
|
| @@ -298,6 +308,10 @@ class Element implements Spannable {
|
| return null;
|
| }
|
|
|
| + /**
|
| + * Returns the member enclosing this element or the element itself if it is a
|
| + * member. If no enclosing element is found, [:null:] is returned.
|
| + */
|
| Element getEnclosingMember() {
|
| for (Element e = this; e != null; e = e.enclosingElement) {
|
| if (e.isMember()) return e;
|
|
|