| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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.modelx; | 5 library elements.modelx; |
| 6 | 6 |
| 7 import 'dart:collection' show LinkedHashMap; | 7 import 'dart:collection' show LinkedHashMap; |
| 8 | 8 |
| 9 import 'elements.dart'; | 9 import 'elements.dart'; |
| 10 import '../../compiler.dart' as api; | 10 import '../../compiler.dart' as api; |
| (...skipping 1946 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1957 bool get isPatched => patch != null; | 1957 bool get isPatched => patch != null; |
| 1958 bool get isPatch => origin != null; | 1958 bool get isPatch => origin != null; |
| 1959 bool get hasLocalScopeMembers => !localScope.isEmpty; | 1959 bool get hasLocalScopeMembers => !localScope.isEmpty; |
| 1960 | 1960 |
| 1961 void addMember(Element element, DiagnosticListener listener) { | 1961 void addMember(Element element, DiagnosticListener listener) { |
| 1962 localMembers = localMembers.prepend(element); | 1962 localMembers = localMembers.prepend(element); |
| 1963 addToScope(element, listener); | 1963 addToScope(element, listener); |
| 1964 } | 1964 } |
| 1965 | 1965 |
| 1966 void addToScope(Element element, DiagnosticListener listener) { | 1966 void addToScope(Element element, DiagnosticListener listener) { |
| 1967 if (element.name == name) { |
| 1968 listener.reportError(element, MessageKind.MEMBER_USES_CLASS_NAME); |
| 1969 } |
| 1967 localScope.add(element, listener); | 1970 localScope.add(element, listener); |
| 1968 } | 1971 } |
| 1969 | 1972 |
| 1970 Element localLookup(SourceString elementName) { | 1973 Element localLookup(SourceString elementName) { |
| 1971 Element result = localScope.lookup(elementName); | 1974 Element result = localScope.lookup(elementName); |
| 1972 if (result == null && isPatch) { | 1975 if (result == null && isPatch) { |
| 1973 result = origin.localLookup(elementName); | 1976 result = origin.localLookup(elementName); |
| 1974 } | 1977 } |
| 1975 return result; | 1978 return result; |
| 1976 } | 1979 } |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2219 | 2222 |
| 2220 MetadataAnnotation ensureResolved(Compiler compiler) { | 2223 MetadataAnnotation ensureResolved(Compiler compiler) { |
| 2221 if (resolutionState == STATE_NOT_STARTED) { | 2224 if (resolutionState == STATE_NOT_STARTED) { |
| 2222 compiler.resolver.resolveMetadataAnnotation(this); | 2225 compiler.resolver.resolveMetadataAnnotation(this); |
| 2223 } | 2226 } |
| 2224 return this; | 2227 return this; |
| 2225 } | 2228 } |
| 2226 | 2229 |
| 2227 String toString() => 'MetadataAnnotation($value, $resolutionState)'; | 2230 String toString() => 'MetadataAnnotation($value, $resolutionState)'; |
| 2228 } | 2231 } |
| OLD | NEW |