Chromium Code Reviews| Index: lib/compiler/implementation/elements/elements.dart |
| =================================================================== |
| --- lib/compiler/implementation/elements/elements.dart (revision 11962) |
| +++ lib/compiler/implementation/elements/elements.dart (working copy) |
| @@ -648,9 +648,7 @@ |
| DartType get type => variables.type; |
| - bool isInstanceMember() { |
| - return isMember() && !modifiers.isStatic(); |
| - } |
| + bool isInstanceMember() => variables.isInstanceMember(); |
| // Note: cachedNode.getBeginToken() will not be correct in all |
| // cases, for example, for function typed parameters. |
| @@ -759,6 +757,19 @@ |
| } |
| return result; |
| } |
| + |
| + bool isInstanceMember() { |
| + return isMember() && !modifiers.isStatic(); |
| + } |
| + |
| + Scope buildScope() { |
|
ahe
2012/10/01 16:17:28
I think this method is problematic for several rea
|
| + Scope result = new VariableScope(enclosingElement.buildScope(), this); |
| + if (enclosingElement.isClass()) { |
| + ClassScope clsScope = result.parent; |
| + clsScope.inStaticContext = !isInstanceMember(); |
| + } |
| + return result; |
| + } |
| } |
| class ForeignElement extends Element { |
| @@ -993,6 +1004,15 @@ |
| result.type = type; |
| return result; |
| } |
| + |
| + Scope buildScope() { |
| + Scope result = new MethodScope(enclosingElement.buildScope(), this); |
| + if (enclosingElement.isClass()) { |
| + ClassScope clsScope = result.parent; |
| + clsScope.inStaticContext = !isInstanceMember() && !isConstructor(); |
| + } |
| + return result; |
| + } |
| } |