| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 analyzer.src.dart.element.element; | 5 library analyzer.src.dart.element.element; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 import 'dart:math' show min; | 8 import 'dart:math' show min; |
| 9 | 9 |
| 10 import 'package:analyzer/dart/ast/ast.dart'; | 10 import 'package:analyzer/dart/ast/ast.dart'; |
| (...skipping 1550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1561 /** | 1561 /** |
| 1562 * The name of the top-level variable used to mark a class as implementing a | 1562 * The name of the top-level variable used to mark a class as implementing a |
| 1563 * proxy object. | 1563 * proxy object. |
| 1564 */ | 1564 */ |
| 1565 static String PROXY_VARIABLE_NAME = "proxy"; | 1565 static String PROXY_VARIABLE_NAME = "proxy"; |
| 1566 | 1566 |
| 1567 /** | 1567 /** |
| 1568 * The element representing the field, variable, or constructor being used as | 1568 * The element representing the field, variable, or constructor being used as |
| 1569 * an annotation. | 1569 * an annotation. |
| 1570 */ | 1570 */ |
| 1571 Element element; | 1571 final Element element; |
| 1572 | |
| 1573 /** | |
| 1574 * The element which this annotation annotates. | |
| 1575 */ | |
| 1576 final Element annotatedElement; | |
| 1577 | 1572 |
| 1578 /** | 1573 /** |
| 1579 * The result of evaluating this annotation as a compile-time constant | 1574 * The result of evaluating this annotation as a compile-time constant |
| 1580 * expression, or `null` if the compilation unit containing the variable has | 1575 * expression, or `null` if the compilation unit containing the variable has |
| 1581 * not been resolved. | 1576 * not been resolved. |
| 1582 */ | 1577 */ |
| 1583 EvaluationResultImpl evaluationResult; | 1578 EvaluationResultImpl evaluationResult; |
| 1584 | 1579 |
| 1585 /** | 1580 /** |
| 1586 * Initialize a newly created annotation. The given [annotatedElement] is the | 1581 * Initialize a newly created annotation. The given [element] is the element |
| 1587 * element to which the annotation is being applied. | 1582 * representing the field, variable, or constructor being used as an |
| 1583 * annotation. |
| 1588 */ | 1584 */ |
| 1589 ElementAnnotationImpl(this.annotatedElement); | 1585 ElementAnnotationImpl(this.element); |
| 1590 | 1586 |
| 1591 @override | 1587 @override |
| 1592 DartObject get constantValue => evaluationResult.value; | 1588 DartObject get constantValue => evaluationResult.value; |
| 1593 | 1589 |
| 1594 @override | 1590 @override |
| 1595 bool get isDeprecated { | 1591 bool get isDeprecated { |
| 1596 if (element != null) { | 1592 if (element != null) { |
| 1597 LibraryElement library = element.library; | 1593 LibraryElement library = element.library; |
| 1598 if (library != null && library.isDartCore) { | 1594 if (library != null && library.isDartCore) { |
| 1599 if (element is ConstructorElement) { | 1595 if (element is ConstructorElement) { |
| (...skipping 3172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4772 | 4768 |
| 4773 @override | 4769 @override |
| 4774 void visitElement(Element element) { | 4770 void visitElement(Element element) { |
| 4775 int offset = element.nameOffset; | 4771 int offset = element.nameOffset; |
| 4776 if (offset != -1) { | 4772 if (offset != -1) { |
| 4777 map[offset] = element; | 4773 map[offset] = element; |
| 4778 } | 4774 } |
| 4779 super.visitElement(element); | 4775 super.visitElement(element); |
| 4780 } | 4776 } |
| 4781 } | 4777 } |
| OLD | NEW |