| 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('elements'); | 5 #library('elements'); |
| 6 | 6 |
| 7 #import('../tree/tree.dart'); | 7 #import('../tree/tree.dart'); |
| 8 #import('../scanner/scannerlib.dart'); | 8 #import('../scanner/scannerlib.dart'); |
| 9 #import('../leg.dart'); // TODO(karlklose): we only need type. | 9 #import('../leg.dart'); // TODO(karlklose): we only need type. |
| 10 #import('../util/util.dart'); | 10 #import('../util/util.dart'); |
| (...skipping 731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 742 Element e = s.lookupLocalMember(memberName); | 742 Element e = s.lookupLocalMember(memberName); |
| 743 if (e !== null) { | 743 if (e !== null) { |
| 744 if (!memberName.isPrivate() || getLibrary() === e.getLibrary()) { | 744 if (!memberName.isPrivate() || getLibrary() === e.getLibrary()) { |
| 745 return e; | 745 return e; |
| 746 } | 746 } |
| 747 } | 747 } |
| 748 } | 748 } |
| 749 return null; | 749 return null; |
| 750 } | 750 } |
| 751 | 751 |
| 752 /** |
| 753 * Find the first member in the class chain with the given |
| 754 * [memberName]. This method is NOT to be used for resolving |
| 755 * unqualified sends because it does not implement the scoping |
| 756 * rules, where library scope comes before superclass scope. |
| 757 */ |
| 758 Element lookupMember(SourceString memberName) { |
| 759 Element localMember = localMembers[memberName]; |
| 760 return localMember === null ? lookupSuperMember(memberName) : localMember; |
| 761 } |
| 762 |
| 752 Element lookupConstructor(SourceString className, | 763 Element lookupConstructor(SourceString className, |
| 753 [SourceString constructorName = | 764 [SourceString constructorName = |
| 754 const SourceString(''), | 765 const SourceString(''), |
| 755 Element noMatch(Element)]) { | 766 Element noMatch(Element)]) { |
| 756 // TODO(karlklose): have a map from class names to a map of constructors | 767 // TODO(karlklose): have a map from class names to a map of constructors |
| 757 // instead of creating the name here? | 768 // instead of creating the name here? |
| 758 SourceString normalizedName; | 769 SourceString normalizedName; |
| 759 if (constructorName !== const SourceString('')) { | 770 if (constructorName !== const SourceString('')) { |
| 760 normalizedName = Elements.constructConstructorName(className, | 771 normalizedName = Elements.constructConstructorName(className, |
| 761 constructorName); | 772 constructorName); |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1016 final Node node; | 1027 final Node node; |
| 1017 Type bound; | 1028 Type bound; |
| 1018 Type type; | 1029 Type type; |
| 1019 TypeVariableElement(name, Element enclosing, this.node, this.type, | 1030 TypeVariableElement(name, Element enclosing, this.node, this.type, |
| 1020 [this.bound]) | 1031 [this.bound]) |
| 1021 : super(name, ElementKind.TYPE_VARIABLE, enclosing); | 1032 : super(name, ElementKind.TYPE_VARIABLE, enclosing); |
| 1022 Type computeType(compiler) => type; | 1033 Type computeType(compiler) => type; |
| 1023 Node parseNode(compiler) => node; | 1034 Node parseNode(compiler) => node; |
| 1024 toString() => "${enclosingElement.toString()}.${name.slowToString()}"; | 1035 toString() => "${enclosingElement.toString()}.${name.slowToString()}"; |
| 1025 } | 1036 } |
| OLD | NEW |