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 '../common/resolution.dart' show | 7 import '../common/resolution.dart' show |
8 Resolution, | 8 Resolution, |
9 Parsing; | 9 Parsing; |
10 import '../compiler.dart' show | 10 import '../compiler.dart' show |
(...skipping 2577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2588 } | 2588 } |
2589 return null; | 2589 return null; |
2590 } | 2590 } |
2591 | 2591 |
2592 /** | 2592 /** |
2593 * Returns the super class, if any. | 2593 * Returns the super class, if any. |
2594 * | 2594 * |
2595 * The returned element may not be resolved yet. | 2595 * The returned element may not be resolved yet. |
2596 */ | 2596 */ |
2597 ClassElement get superclass { | 2597 ClassElement get superclass { |
2598 assert(supertypeLoadState == STATE_DONE); | 2598 assert(invariant(this, supertypeLoadState == STATE_DONE, |
| 2599 message: "Superclass has not been computed for $this.")); |
2599 return supertype == null ? null : supertype.element; | 2600 return supertype == null ? null : supertype.element; |
2600 } | 2601 } |
2601 | 2602 |
2602 void forEachBackendMember(void f(Element member)) { | 2603 void forEachBackendMember(void f(Element member)) { |
2603 backendMembers.forEach(f); | 2604 backendMembers.forEach(f); |
2604 } | 2605 } |
2605 | 2606 |
2606 bool implementsFunction(Compiler compiler) { | 2607 bool implementsFunction(Compiler compiler) { |
2607 return asInstanceOf(compiler.functionClass) != null || callType != null; | 2608 return asInstanceOf(compiler.functionClass) != null || callType != null; |
2608 } | 2609 } |
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3105 AstElement get definingElement; | 3106 AstElement get definingElement; |
3106 | 3107 |
3107 bool get hasResolvedAst => definingElement.hasTreeElements; | 3108 bool get hasResolvedAst => definingElement.hasTreeElements; |
3108 | 3109 |
3109 ResolvedAst get resolvedAst { | 3110 ResolvedAst get resolvedAst { |
3110 return new ResolvedAst(declaration, | 3111 return new ResolvedAst(declaration, |
3111 definingElement.node, definingElement.treeElements); | 3112 definingElement.node, definingElement.treeElements); |
3112 } | 3113 } |
3113 | 3114 |
3114 } | 3115 } |
OLD | NEW |