| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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; | 5 library elements; |
| 6 | 6 |
| 7 | 7 |
| 8 import '../tree/tree.dart'; | 8 import '../tree/tree.dart'; |
| 9 import '../util/util.dart'; | 9 import '../util/util.dart'; |
| 10 import '../resolution/resolution.dart'; | 10 import '../resolution/resolution.dart'; |
| (...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 | 342 |
| 343 static bool isInstanceMethod(Element element) { | 343 static bool isInstanceMethod(Element element) { |
| 344 return !Elements.isUnresolved(element) | 344 return !Elements.isUnresolved(element) |
| 345 && element.isInstanceMember() | 345 && element.isInstanceMember() |
| 346 && (identical(element.kind, ElementKind.FUNCTION)); | 346 && (identical(element.kind, ElementKind.FUNCTION)); |
| 347 } | 347 } |
| 348 | 348 |
| 349 static bool isNativeOrExtendsNative(ClassElement element) { | 349 static bool isNativeOrExtendsNative(ClassElement element) { |
| 350 if (element == null) return false; | 350 if (element == null) return false; |
| 351 if (element.isNative()) return true; | 351 if (element.isNative()) return true; |
| 352 assert(element.resolutionState == STATE_DONE); |
| 352 return isNativeOrExtendsNative(element.superclass); | 353 return isNativeOrExtendsNative(element.superclass); |
| 353 } | 354 } |
| 354 | 355 |
| 355 static bool isInstanceSend(Send send, TreeElements elements) { | 356 static bool isInstanceSend(Send send, TreeElements elements) { |
| 356 Element element = elements[send]; | 357 Element element = elements[send]; |
| 357 if (element == null) return !isClosureSend(send, element); | 358 if (element == null) return !isClosureSend(send, element); |
| 358 return isInstanceMethod(element) || isInstanceField(element); | 359 return isInstanceMethod(element) || isInstanceField(element); |
| 359 } | 360 } |
| 360 | 361 |
| 361 static bool isClosureSend(Send send, Element element) { | 362 static bool isClosureSend(Send send, Element element) { |
| (...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 972 int get resolutionState; | 973 int get resolutionState; |
| 973 Token get beginToken; | 974 Token get beginToken; |
| 974 Token get endToken; | 975 Token get endToken; |
| 975 | 976 |
| 976 // TODO(kasperl): Try to get rid of these. | 977 // TODO(kasperl): Try to get rid of these. |
| 977 void set annotatedElement(Element value); | 978 void set annotatedElement(Element value); |
| 978 void set resolutionState(int value); | 979 void set resolutionState(int value); |
| 979 | 980 |
| 980 MetadataAnnotation ensureResolved(Compiler compiler); | 981 MetadataAnnotation ensureResolved(Compiler compiler); |
| 981 } | 982 } |
| OLD | NEW |