Chromium Code Reviews| Index: sdk/lib/_internal/compiler/implementation/elements/modelx.dart |
| =================================================================== |
| --- sdk/lib/_internal/compiler/implementation/elements/modelx.dart (revision 19450) |
| +++ sdk/lib/_internal/compiler/implementation/elements/modelx.dart (working copy) |
| @@ -1522,10 +1522,18 @@ |
| * origin and the patch class are returned. |
| */ |
| Element lookupSelector(Selector selector) { |
| + return internalLookupSelector(selector, false); |
| + } |
| + |
| + Element lookupSuperSelector(Selector selector) { |
| + return internalLookupSelector(selector, true); |
| + } |
| + |
| + Element internalLookupSelector(Selector selector, bool isSuperLookup) { |
| SourceString name = selector.name; |
| bool isPrivate = name.isPrivate(); |
| LibraryElement library = selector.library; |
| - for (ClassElement current = this; |
| + for (ClassElement current = isSuperLookup ? getEnclosingClass() : this; |
|
kasperl
2013/03/05 08:57:42
When is the enclosing class of a class element not
ngeoffray
2013/03/05 09:09:40
That was a braino caught by tests: should have bee
|
| current != null; |
| current = current.superclass) { |
| Element member = current.lookupLocalMember(name); |
| @@ -1533,7 +1541,9 @@ |
| // Private members from a different library are not visible. |
| if (isPrivate && !identical(library, member.getLibrary())) continue; |
| // Static members are not inherited. |
| - if (member.modifiers.isStatic() && !identical(this, current)) continue; |
| + if (member.modifiers.isStatic() && !identical(this, current)) { |
|
kasperl
2013/03/05 08:57:42
Fits on one line?
ngeoffray
2013/03/05 09:09:40
Done.
|
| + continue; |
| + } |
| // If we find an abstract field we have to make sure that it has |
| // the getter or setter part we're actually looking |
| // for. Otherwise, we continue up the superclass chain. |