| Index: frog/leg/elements/elements.dart
|
| diff --git a/frog/leg/elements/elements.dart b/frog/leg/elements/elements.dart
|
| index f39d2457d8771d8bb38585ba63fd171751bd1637..0306806b24e4de28b8d060c2cc21694c7fdd49b3 100644
|
| --- a/frog/leg/elements/elements.dart
|
| +++ b/frog/leg/elements/elements.dart
|
| @@ -624,18 +624,25 @@ class Elements {
|
| || element.kind === ElementKind.SETTER);
|
| }
|
|
|
| - static bool isStaticOrTopLevelField(Element element) {
|
| + static bool isStaticOrTopLevel(Element element) {
|
| return (element != null)
|
| && !element.isInstanceMember()
|
| + && element.enclosingElement !== null
|
| + && (element.enclosingElement.kind == ElementKind.CLASS ||
|
| + element.enclosingElement.kind == ElementKind.COMPILATION_UNIT ||
|
| + element.enclosingElement.kind == ElementKind.LIBRARY);
|
| + }
|
| +
|
| + static bool isStaticOrTopLevelField(Element element) {
|
| + return isStaticOrTopLevel(element)
|
| && (element.kind === ElementKind.FIELD
|
| || element.kind === ElementKind.GETTER
|
| || element.kind === ElementKind.SETTER);
|
| }
|
|
|
| static bool isStaticOrTopLevelFunction(Element element) {
|
| - return (element != null)
|
| - && !element.isInstanceMember()
|
| - && (element.kind === ElementKind.FUNCTION);
|
| + return isStaticOrTopLevel(element)
|
| + && (element.kind === ElementKind.FUNCTION);
|
| }
|
|
|
| static bool isInstanceMethod(Element element) {
|
| @@ -658,7 +665,7 @@ class Elements {
|
| if (element === null && send.selector.asIdentifier() === null) return true;
|
| if (element === null) return false;
|
| // foo() with foo a local or a parameter.
|
| - return element.isVariable() || element.isParameter();
|
| + return isLocal(element);
|
| }
|
|
|
| static SourceString constructConstructorName(SourceString receiver,
|
|
|