| 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 1941 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1952 bool get hasConstructor { | 1952 bool get hasConstructor { |
| 1953 // Search in scope to be sure we search patched constructors. | 1953 // Search in scope to be sure we search patched constructors. |
| 1954 for (var element in localScope.values) { | 1954 for (var element in localScope.values) { |
| 1955 if (element.isConstructor()) return true; | 1955 if (element.isConstructor()) return true; |
| 1956 } | 1956 } |
| 1957 return false; | 1957 return false; |
| 1958 } | 1958 } |
| 1959 | 1959 |
| 1960 void setDefaultConstructor(FunctionElement constructor, Compiler compiler) { | 1960 void setDefaultConstructor(FunctionElement constructor, Compiler compiler) { |
| 1961 addToScope(constructor, compiler); | 1961 addToScope(constructor, compiler); |
| 1962 // The default constructor, although synthetic, is part of a class' API. |
| 1963 localMembers = localMembers.prepend(constructor); |
| 1962 } | 1964 } |
| 1963 | 1965 |
| 1964 Link<DartType> computeTypeParameters(Compiler compiler) { | 1966 Link<DartType> computeTypeParameters(Compiler compiler) { |
| 1965 ClassNode node = parseNode(compiler); | 1967 ClassNode node = parseNode(compiler); |
| 1966 return TypeDeclarationElementX.createTypeVariables( | 1968 return TypeDeclarationElementX.createTypeVariables( |
| 1967 this, node.typeParameters); | 1969 this, node.typeParameters); |
| 1968 } | 1970 } |
| 1969 | 1971 |
| 1970 Scope buildScope() => new ClassScope(enclosingElement.buildScope(), this); | 1972 Scope buildScope() => new ClassScope(enclosingElement.buildScope(), this); |
| 1971 | 1973 |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2186 | 2188 |
| 2187 MetadataAnnotation ensureResolved(Compiler compiler) { | 2189 MetadataAnnotation ensureResolved(Compiler compiler) { |
| 2188 if (resolutionState == STATE_NOT_STARTED) { | 2190 if (resolutionState == STATE_NOT_STARTED) { |
| 2189 compiler.resolver.resolveMetadataAnnotation(this); | 2191 compiler.resolver.resolveMetadataAnnotation(this); |
| 2190 } | 2192 } |
| 2191 return this; | 2193 return this; |
| 2192 } | 2194 } |
| 2193 | 2195 |
| 2194 String toString() => 'MetadataAnnotation($value, $resolutionState)'; | 2196 String toString() => 'MetadataAnnotation($value, $resolutionState)'; |
| 2195 } | 2197 } |
| OLD | NEW |