Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(68)

Side by Side Diff: pkg/compiler/lib/src/typechecker.dart

Issue 2620363002: Introduce LibraryEntity (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library dart2js.typechecker; 5 library dart2js.typechecker;
6 6
7 import 'common/names.dart' show Identifiers; 7 import 'common/names.dart' show Identifiers;
8 import 'common/resolution.dart' show Resolution; 8 import 'common/resolution.dart' show Resolution;
9 import 'common/tasks.dart' show CompilerTask; 9 import 'common/tasks.dart' show CompilerTask;
10 import 'common.dart'; 10 import 'common.dart';
(...skipping 790 matching lines...) Expand 10 before | Expand all | Expand 10 after
801 // We didn't find a member with the correct name. If this lookup is for a 801 // We didn't find a member with the correct name. If this lookup is for a
802 // super or redirecting initializer, the resolver has already emitted an 802 // super or redirecting initializer, the resolver has already emitted an
803 // error message. If the target is a proxy, no warning needs to be emitted. 803 // error message. If the target is a proxy, no warning needs to be emitted.
804 // Otherwise, try to emit the most precise warning. 804 // Otherwise, try to emit the most precise warning.
805 if (!interface.element.isProxy && !analyzingInitializer) { 805 if (!interface.element.isProxy && !analyzingInitializer) {
806 bool foundPrivateMember = false; 806 bool foundPrivateMember = false;
807 if (memberName.isPrivate) { 807 if (memberName.isPrivate) {
808 void findPrivateMember(MemberSignature member) { 808 void findPrivateMember(MemberSignature member) {
809 if (memberName.isSimilarTo(member.name)) { 809 if (memberName.isSimilarTo(member.name)) {
810 PrivateName privateName = member.name; 810 PrivateName privateName = member.name;
811 LibraryElement library = privateName.library;
811 reportMessage( 812 reportMessage(
812 node, 813 node,
813 MessageKind.PRIVATE_ACCESS, 814 MessageKind.PRIVATE_ACCESS,
814 { 815 {
815 'name': name, 816 'name': name,
816 'libraryName': privateName.library.libraryOrScriptName 817 'libraryName': library.libraryOrScriptName
817 }, 818 },
818 isHint: isHint); 819 isHint: isHint);
819 foundPrivateMember = true; 820 foundPrivateMember = true;
820 } 821 }
821 } 822 }
822 823
823 // TODO(johnniwinther): Avoid computation of all class members. 824 // TODO(johnniwinther): Avoid computation of all class members.
824 MembersCreator.computeAllClassMembers(resolution, interface.element); 825 MembersCreator.computeAllClassMembers(resolution, interface.element);
825 if (lookupClassMember) { 826 if (lookupClassMember) {
826 interface.element.forEachClassMember(findPrivateMember); 827 interface.element.forEachClassMember(findPrivateMember);
(...skipping 1222 matching lines...) Expand 10 before | Expand all | Expand 10 after
2049 2050
2050 visitTypedef(Typedef node) { 2051 visitTypedef(Typedef node) {
2051 // Do not typecheck [Typedef] nodes. 2052 // Do not typecheck [Typedef] nodes.
2052 } 2053 }
2053 2054
2054 visitNode(Node node) { 2055 visitNode(Node node) {
2055 reporter.internalError(node, 2056 reporter.internalError(node,
2056 'Unexpected node ${node.getObjectDescription()} in the type checker.'); 2057 'Unexpected node ${node.getObjectDescription()} in the type checker.');
2057 } 2058 }
2058 } 2059 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698