| OLD | NEW |
| 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 791 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 LibraryElement library = privateName.library; |
| 812 reportMessage( | 812 reportMessage(node, MessageKind.PRIVATE_ACCESS, |
| 813 node, | 813 {'name': name, 'libraryName': library.libraryOrScriptName}, |
| 814 MessageKind.PRIVATE_ACCESS, | |
| 815 { | |
| 816 'name': name, | |
| 817 'libraryName': library.libraryOrScriptName | |
| 818 }, | |
| 819 isHint: isHint); | 814 isHint: isHint); |
| 820 foundPrivateMember = true; | 815 foundPrivateMember = true; |
| 821 } | 816 } |
| 822 } | 817 } |
| 823 | 818 |
| 824 // TODO(johnniwinther): Avoid computation of all class members. | 819 // TODO(johnniwinther): Avoid computation of all class members. |
| 825 MembersCreator.computeAllClassMembers(resolution, interface.element); | 820 MembersCreator.computeAllClassMembers(resolution, interface.element); |
| 826 if (lookupClassMember) { | 821 if (lookupClassMember) { |
| 827 interface.element.forEachClassMember(findPrivateMember); | 822 interface.element.forEachClassMember(findPrivateMember); |
| 828 } else { | 823 } else { |
| (...skipping 1221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2050 | 2045 |
| 2051 visitTypedef(Typedef node) { | 2046 visitTypedef(Typedef node) { |
| 2052 // Do not typecheck [Typedef] nodes. | 2047 // Do not typecheck [Typedef] nodes. |
| 2053 } | 2048 } |
| 2054 | 2049 |
| 2055 visitNode(Node node) { | 2050 visitNode(Node node) { |
| 2056 reporter.internalError(node, | 2051 reporter.internalError(node, |
| 2057 'Unexpected node ${node.getObjectDescription()} in the type checker.'); | 2052 'Unexpected node ${node.getObjectDescription()} in the type checker.'); |
| 2058 } | 2053 } |
| 2059 } | 2054 } |
| OLD | NEW |