| 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 part of resolution; | 5 part of resolution; |
| 6 | 6 |
| 7 abstract class TreeElements { | 7 abstract class TreeElements { |
| 8 AnalyzableElement get analyzedElement; | 8 AnalyzableElement get analyzedElement; |
| 9 Iterable<Node> get superUses; | 9 Iterable<Node> get superUses; |
| 10 | 10 |
| (...skipping 2625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2636 | 2636 |
| 2637 // TODO(karlklose): this should be reported by the caller of | 2637 // TODO(karlklose): this should be reported by the caller of |
| 2638 // [resolveSend] to select better warning messages for getters and | 2638 // [resolveSend] to select better warning messages for getters and |
| 2639 // setters. | 2639 // setters. |
| 2640 MessageKind kind = (target == null) | 2640 MessageKind kind = (target == null) |
| 2641 ? MessageKind.MEMBER_NOT_FOUND | 2641 ? MessageKind.MEMBER_NOT_FOUND |
| 2642 : MessageKind.MEMBER_NOT_STATIC; | 2642 : MessageKind.MEMBER_NOT_STATIC; |
| 2643 return new ElementResult(warnAndCreateErroneousElement( | 2643 return new ElementResult(warnAndCreateErroneousElement( |
| 2644 node, name, kind, | 2644 node, name, kind, |
| 2645 {'className': receiverClass.name, 'memberName': name})); | 2645 {'className': receiverClass.name, 'memberName': name})); |
| 2646 } else if (isPrivateName(name) && |
| 2647 target.library != enclosingElement.library) { |
| 2648 registry.registerThrowNoSuchMethod(); |
| 2649 return new ElementResult(warnAndCreateErroneousElement( |
| 2650 node, name, MessageKind.PRIVATE_ACCESS, |
| 2651 {'libraryName': target.library.getLibraryOrScriptName(), |
| 2652 'name': name})); |
| 2646 } | 2653 } |
| 2647 } else if (resolvedReceiver.element.isPrefix) { | 2654 } else if (resolvedReceiver.element.isPrefix) { |
| 2648 PrefixElement prefix = resolvedReceiver.element; | 2655 PrefixElement prefix = resolvedReceiver.element; |
| 2649 target = prefix.lookupLocalMember(name); | 2656 target = prefix.lookupLocalMember(name); |
| 2650 if (Elements.isUnresolved(target)) { | 2657 if (Elements.isUnresolved(target)) { |
| 2651 registry.registerThrowNoSuchMethod(); | 2658 registry.registerThrowNoSuchMethod(); |
| 2652 return new ElementResult(warnAndCreateErroneousElement( | 2659 return new ElementResult(warnAndCreateErroneousElement( |
| 2653 node, name, MessageKind.NO_SUCH_LIBRARY_MEMBER, | 2660 node, name, MessageKind.NO_SUCH_LIBRARY_MEMBER, |
| 2654 {'libraryName': prefix.name, 'memberName': name})); | 2661 {'libraryName': prefix.name, 'memberName': name})); |
| 2655 } else if (target.isAmbiguous) { | 2662 } else if (target.isAmbiguous) { |
| (...skipping 2279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4935 } | 4942 } |
| 4936 | 4943 |
| 4937 /// The result for the resolution of the `assert` method. | 4944 /// The result for the resolution of the `assert` method. |
| 4938 class AssertResult implements ResolutionResult { | 4945 class AssertResult implements ResolutionResult { |
| 4939 const AssertResult(); | 4946 const AssertResult(); |
| 4940 | 4947 |
| 4941 Element get element => null; | 4948 Element get element => null; |
| 4942 | 4949 |
| 4943 String toString() => 'AssertResult()'; | 4950 String toString() => 'AssertResult()'; |
| 4944 } | 4951 } |
| OLD | NEW |