| 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 '../constants/expressions.dart'; | 8 import '../constants/expressions.dart'; |
| 9 import '../tree/tree.dart'; | 9 import '../tree/tree.dart'; |
| 10 import '../util/util.dart'; | 10 import '../util/util.dart'; |
| (...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 421 /// Returns the [Element] that holds the [TreeElements] for this element. | 421 /// Returns the [Element] that holds the [TreeElements] for this element. |
| 422 AnalyzableElement get analyzableElement; | 422 AnalyzableElement get analyzableElement; |
| 423 | 423 |
| 424 accept(ElementVisitor visitor); | 424 accept(ElementVisitor visitor); |
| 425 } | 425 } |
| 426 | 426 |
| 427 class Elements { | 427 class Elements { |
| 428 static bool isUnresolved(Element e) { | 428 static bool isUnresolved(Element e) { |
| 429 return e == null || e.isErroneous; | 429 return e == null || e.isErroneous; |
| 430 } | 430 } |
| 431 static bool isErroneousElement(Element e) => e != null && e.isErroneous; | 431 static bool isErroneous(Element e) => e != null && e.isErroneous; |
| 432 | 432 |
| 433 /// Unwraps [element] reporting any warnings attached to it, if any. | 433 /// Unwraps [element] reporting any warnings attached to it, if any. |
| 434 static Element unwrap(Element element, | 434 static Element unwrap(Element element, |
| 435 DiagnosticListener listener, | 435 DiagnosticListener listener, |
| 436 Spannable spannable) { | 436 Spannable spannable) { |
| 437 if (element != null && element.isWarnOnUse) { | 437 if (element != null && element.isWarnOnUse) { |
| 438 WarnOnUseElement wrappedElement = element; | 438 WarnOnUseElement wrappedElement = element; |
| 439 element = wrappedElement.unwrap(listener, spannable); | 439 element = wrappedElement.unwrap(listener, spannable); |
| 440 } | 440 } |
| 441 return element; | 441 return element; |
| (...skipping 1171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1613 bool get isDeclaredByField; | 1613 bool get isDeclaredByField; |
| 1614 | 1614 |
| 1615 /// Returns `true` if this member is abstract. | 1615 /// Returns `true` if this member is abstract. |
| 1616 bool get isAbstract; | 1616 bool get isAbstract; |
| 1617 | 1617 |
| 1618 /// If abstract, [implementation] points to the overridden concrete member, | 1618 /// If abstract, [implementation] points to the overridden concrete member, |
| 1619 /// if any. Otherwise [implementation] points to the member itself. | 1619 /// if any. Otherwise [implementation] points to the member itself. |
| 1620 Member get implementation; | 1620 Member get implementation; |
| 1621 } | 1621 } |
| 1622 | 1622 |
| OLD | NEW |