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 '../helpers/helpers.dart'; | 8 import '../helpers/helpers.dart'; |
9 import '../tree/tree.dart'; | 9 import '../tree/tree.dart'; |
10 import '../util/util.dart'; | 10 import '../util/util.dart'; |
(...skipping 2251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2262 // Use [declaration] for both [this] and [cls], because | 2262 // Use [declaration] for both [this] and [cls], because |
2263 // declaration classes hold the superclass hierarchy. | 2263 // declaration classes hold the superclass hierarchy. |
2264 cls = cls.declaration; | 2264 cls = cls.declaration; |
2265 for (ClassElement s = declaration; s != null; s = s.superclass) { | 2265 for (ClassElement s = declaration; s != null; s = s.superclass) { |
2266 if (identical(s, cls)) return true; | 2266 if (identical(s, cls)) return true; |
2267 } | 2267 } |
2268 return false; | 2268 return false; |
2269 } | 2269 } |
2270 | 2270 |
2271 bool get isNative => nativeTagInfo != null; | 2271 bool get isNative => nativeTagInfo != null; |
| 2272 |
2272 void setNative(String name) { | 2273 void setNative(String name) { |
| 2274 assert(invariant(this, nativeTagInfo == null, |
| 2275 message: "Native tag info set twice on $this.")); |
2273 nativeTagInfo = name; | 2276 nativeTagInfo = name; |
2274 } | 2277 } |
2275 | 2278 |
2276 FunctionType get callType { | 2279 FunctionType get callType { |
2277 MemberSignature member = | 2280 MemberSignature member = |
2278 lookupInterfaceMember(const PublicName(Compiler.CALL_OPERATOR_NAME)); | 2281 lookupInterfaceMember(const PublicName(Compiler.CALL_OPERATOR_NAME)); |
2279 return member != null && member.isMethod ? member.type : null; | 2282 return member != null && member.isMethod ? member.type : null; |
2280 } | 2283 } |
2281 | 2284 |
2282 // TODO(johnniwinther): Remove these when issue 18630 is fixed. | 2285 // TODO(johnniwinther): Remove these when issue 18630 is fixed. |
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2665 AstElement get definingElement; | 2668 AstElement get definingElement; |
2666 | 2669 |
2667 bool get hasResolvedAst => definingElement.hasTreeElements; | 2670 bool get hasResolvedAst => definingElement.hasTreeElements; |
2668 | 2671 |
2669 ResolvedAst get resolvedAst { | 2672 ResolvedAst get resolvedAst { |
2670 return new ResolvedAst(declaration, | 2673 return new ResolvedAst(declaration, |
2671 definingElement.node, definingElement.treeElements); | 2674 definingElement.node, definingElement.treeElements); |
2672 } | 2675 } |
2673 | 2676 |
2674 } | 2677 } |
OLD | NEW |