Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(280)

Side by Side Diff: pkg/analyzer/lib/src/dart/element/element.dart

Issue 1668483003: Create ElementAnnotation objects prior to resolution. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 final Element element; 1571 Element element;
1572
1573 /**
1574 * The compliation unit in which this annotation appears.
1575 */
1576 final CompilationUnitElement compilationUnit;
1572 1577
1573 /** 1578 /**
1574 * The result of evaluating this annotation as a compile-time constant 1579 * The result of evaluating this annotation as a compile-time constant
1575 * expression, or `null` if the compilation unit containing the variable has 1580 * expression, or `null` if the compilation unit containing the variable has
1576 * not been resolved. 1581 * not been resolved.
1577 */ 1582 */
1578 EvaluationResultImpl evaluationResult; 1583 EvaluationResultImpl evaluationResult;
1579 1584
1580 /** 1585 /**
1581 * Initialize a newly created annotation. The given [element] is the element 1586 * Initialize a newly created annotation. The given [compilationUnit] is the
1582 * representing the field, variable, or constructor being used as an 1587 * compilation unit in which the annotation appears.
1583 * annotation.
1584 */ 1588 */
1585 ElementAnnotationImpl(this.element); 1589 ElementAnnotationImpl(this.compilationUnit);
1586 1590
1587 @override 1591 @override
1588 DartObject get constantValue => evaluationResult.value; 1592 DartObject get constantValue => evaluationResult.value;
1589 1593
1590 @override 1594 @override
1591 bool get isDeprecated { 1595 bool get isDeprecated {
1592 if (element != null) { 1596 if (element != null) {
1593 LibraryElement library = element.library; 1597 LibraryElement library = element.library;
1594 if (library != null && library.isDartCore) { 1598 if (library != null && library.isDartCore) {
1595 if (element is ConstructorElement) { 1599 if (element is ConstructorElement) {
(...skipping 3172 matching lines...) Expand 10 before | Expand all | Expand 10 after
4768 4772
4769 @override 4773 @override
4770 void visitElement(Element element) { 4774 void visitElement(Element element) {
4771 int offset = element.nameOffset; 4775 int offset = element.nameOffset;
4772 if (offset != -1) { 4776 if (offset != -1) {
4773 map[offset] = element; 4777 map[offset] = element;
4774 } 4778 }
4775 super.visitElement(element); 4779 super.visitElement(element);
4776 } 4780 }
4777 } 4781 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/dart/element/builder.dart ('k') | pkg/analyzer/lib/src/generated/element_resolver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698