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 'elements.dart'; | 7 import 'elements.dart'; |
8 import '../../compiler.dart' as api; | 8 import '../../compiler.dart' as api; |
9 import '../tree/tree.dart'; | 9 import '../tree/tree.dart'; |
10 import '../util/util.dart'; | 10 import '../util/util.dart'; |
(...skipping 2154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2165 } | 2165 } |
2166 } | 2166 } |
2167 | 2167 |
2168 class MixinApplicationElementX extends BaseClassElementX | 2168 class MixinApplicationElementX extends BaseClassElementX |
2169 implements MixinApplicationElement { | 2169 implements MixinApplicationElement { |
2170 final Node node; | 2170 final Node node; |
2171 final Modifiers modifiers; | 2171 final Modifiers modifiers; |
2172 | 2172 |
2173 Link<FunctionElement> constructors = new Link<FunctionElement>(); | 2173 Link<FunctionElement> constructors = new Link<FunctionElement>(); |
2174 | 2174 |
2175 ClassElement mixin; | 2175 InterfaceType mixinType; |
2176 | 2176 |
2177 MixinApplicationElementX(String name, Element enclosing, int id, | 2177 MixinApplicationElementX(String name, Element enclosing, int id, |
2178 this.node, this.modifiers) | 2178 this.node, this.modifiers) |
2179 : super(name, enclosing, id, STATE_NOT_STARTED); | 2179 : super(name, enclosing, id, STATE_NOT_STARTED); |
2180 | 2180 |
| 2181 ClassElement get mixin => mixinType != null ? mixinType.element : null; |
| 2182 |
2181 bool get isMixinApplication => true; | 2183 bool get isMixinApplication => true; |
2182 bool get isUnnamedMixinApplication => node is! NamedMixinApplication; | 2184 bool get isUnnamedMixinApplication => node is! NamedMixinApplication; |
2183 bool get hasConstructor => !constructors.isEmpty; | 2185 bool get hasConstructor => !constructors.isEmpty; |
2184 bool get hasLocalScopeMembers => !constructors.isEmpty; | 2186 bool get hasLocalScopeMembers => !constructors.isEmpty; |
2185 | 2187 |
2186 unsupported(message) { | 2188 unsupported(message) { |
2187 throw new UnsupportedError('$message is not supported on $this'); | 2189 throw new UnsupportedError('$message is not supported on $this'); |
2188 } | 2190 } |
2189 | 2191 |
2190 get patch => null; | 2192 get patch => null; |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2371 | 2373 |
2372 MetadataAnnotation ensureResolved(Compiler compiler) { | 2374 MetadataAnnotation ensureResolved(Compiler compiler) { |
2373 if (resolutionState == STATE_NOT_STARTED) { | 2375 if (resolutionState == STATE_NOT_STARTED) { |
2374 compiler.resolver.resolveMetadataAnnotation(this); | 2376 compiler.resolver.resolveMetadataAnnotation(this); |
2375 } | 2377 } |
2376 return this; | 2378 return this; |
2377 } | 2379 } |
2378 | 2380 |
2379 String toString() => 'MetadataAnnotation($value, $resolutionState)'; | 2381 String toString() => 'MetadataAnnotation($value, $resolutionState)'; |
2380 } | 2382 } |
OLD | NEW |