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

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

Issue 1966323002: Add API to force the computation of constant values (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 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
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/dart/element/element.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 /** 5 /**
6 * Defines the element model. The element model describes the semantic (as 6 * Defines the element model. The element model describes the semantic (as
7 * opposed to syntactic) structure of Dart code. The syntactic structure of the 7 * opposed to syntactic) structure of Dart code. The syntactic structure of the
8 * code is modeled by the [AST structure](../ast/ast.dart). 8 * code is modeled by the [AST structure](../ast/ast.dart).
9 * 9 *
10 * The element model consists of two closely related kinds of objects: elements 10 * The element model consists of two closely related kinds of objects: elements
(...skipping 788 matching lines...) Expand 10 before | Expand all | Expand 10 after
799 799
800 /** 800 /**
801 * Return a representation of the value of this annotation. 801 * Return a representation of the value of this annotation.
802 * 802 *
803 * Return `null` if the value of this annotation could not be computed because 803 * Return `null` if the value of this annotation could not be computed because
804 * of errors. 804 * of errors.
805 */ 805 */
806 DartObject get constantValue; 806 DartObject get constantValue;
807 807
808 /** 808 /**
809 * Return a representation of the value of this annotation, forcing the value
810 * to be computed if it had not previously been computed, or `null` if the
811 * value of this annotation could not be computed because of errors.
812 */
813 DartObject computeConstantValue();
814
815 /**
809 * Return the element representing the field, variable, or const constructor 816 * Return the element representing the field, variable, or const constructor
810 * being used as an annotation. 817 * being used as an annotation.
811 */ 818 */
812 Element get element; 819 Element get element;
813 820
814 /** 821 /**
815 * Return `true` if this annotation marks the associated element as being 822 * Return `true` if this annotation marks the associated element as being
816 * deprecated. 823 * deprecated.
817 */ 824 */
818 bool get isDeprecated; 825 bool get isDeprecated;
(...skipping 1105 matching lines...) Expand 10 before | Expand all | Expand 10 after
1924 /** 1931 /**
1925 * Return a representation of the value of this variable. 1932 * Return a representation of the value of this variable.
1926 * 1933 *
1927 * Return `null` if either this variable was not declared with the 'const' 1934 * Return `null` if either this variable was not declared with the 'const'
1928 * modifier or if the value of this variable could not be computed because of 1935 * modifier or if the value of this variable could not be computed because of
1929 * errors. 1936 * errors.
1930 */ 1937 */
1931 DartObject get constantValue; 1938 DartObject get constantValue;
1932 1939
1933 /** 1940 /**
1941 * Return a representation of the value of this variable, forcing the value
1942 * to be computed if it had not previously been computed, or `null` if either
1943 * this variable was not declared with the 'const' modifier or if the value of
1944 * this variable could not be computed because of errors.
1945 */
1946 DartObject computeConstantValue();
1947
1948 /**
1934 * Return `true` if this variable element did not have an explicit type 1949 * Return `true` if this variable element did not have an explicit type
1935 * specified for it. 1950 * specified for it.
1936 */ 1951 */
1937 bool get hasImplicitType; 1952 bool get hasImplicitType;
1938 1953
1939 /** 1954 /**
1940 * Return a synthetic function representing this variable's initializer, or 1955 * Return a synthetic function representing this variable's initializer, or
1941 * `null` if this variable does not have an initializer. The function will 1956 * `null` if this variable does not have an initializer. The function will
1942 * have no parameters. The return type of the function will be the 1957 * have no parameters. The return type of the function will be the
1943 * compile-time type of the initialization expression. 1958 * compile-time type of the initialization expression.
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
1995 */ 2010 */
1996 bool get isStatic; 2011 bool get isStatic;
1997 2012
1998 /** 2013 /**
1999 * Return the declared type of this variable, or `null` if the variable did 2014 * Return the declared type of this variable, or `null` if the variable did
2000 * not have a declared type (such as if it was declared using the keyword 2015 * not have a declared type (such as if it was declared using the keyword
2001 * 'var'). 2016 * 'var').
2002 */ 2017 */
2003 DartType get type; 2018 DartType get type;
2004 } 2019 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/dart/element/element.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698