| Index: lib/compiler/implementation/elements/elements.dart
|
| diff --git a/lib/compiler/implementation/elements/elements.dart b/lib/compiler/implementation/elements/elements.dart
|
| index 53cf714a52f61cda386d2358ab8bb86f53f85283..778084f1ac497624543c7427eeb4448360e779c7 100644
|
| --- a/lib/compiler/implementation/elements/elements.dart
|
| +++ b/lib/compiler/implementation/elements/elements.dart
|
| @@ -1059,13 +1059,22 @@ class ClassElement extends ScopeContainerElement
|
| }
|
|
|
| /**
|
| - * Lookup super members for the class. This will ignore constructors.
|
| + * Lookup super members for the class. This will ignore constructors.
|
| */
|
| Element lookupSuperMember(SourceString memberName) {
|
| + return lookupSuperMemberInLibrary(memberName, getLibrary());
|
| + }
|
| +
|
| + /**
|
| + * Lookup super members for the class that is accessible in [library].
|
| + * This will ignore constructors.
|
| + */
|
| + Element lookupSuperMemberInLibrary(SourceString memberName,
|
| + LibraryElement library) {
|
| bool isPrivate = memberName.isPrivate();
|
| for (ClassElement s = superclass; s != null; s = s.superclass) {
|
| // Private members from a different library are not visible.
|
| - if (isPrivate && getLibrary() !== s.getLibrary()) continue;
|
| + if (isPrivate && library !== s.getLibrary()) continue;
|
| Element e = s.lookupLocalMember(memberName);
|
| if (e === null) continue;
|
| // Static members are not inherited.
|
| @@ -1094,6 +1103,24 @@ class ClassElement extends ScopeContainerElement
|
| }
|
|
|
| /**
|
| + * Find the first member in the class chain with the given [selector].
|
| + *
|
| + * This method is NOT to be used for resolving
|
| + * unqualified sends because it does not implement the scoping
|
| + * rules, where library scope comes before superclass scope.
|
| + */
|
| + Element lookupSelector(Selector selector) {
|
| + SourceString memberName = selector.name;
|
| + LibraryElement library = selector.library;
|
| + Element localMember = lookupLocalMember(memberName);
|
| + if (localMember != null &&
|
| + (!memberName.isPrivate() || getLibrary() == library)) {
|
| + return localMember;
|
| + }
|
| + return lookupSuperMemberInLibrary(memberName, library);
|
| + }
|
| +
|
| + /**
|
| * Find the first member in the class chain with the given
|
| * [memberName]. This method is NOT to be used for resolving
|
| * unqualified sends because it does not implement the scoping
|
|
|