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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/dart/element/element.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/dart/element/element.dart
diff --git a/pkg/analyzer/lib/dart/element/element.dart b/pkg/analyzer/lib/dart/element/element.dart
index 1a7345767d2ad35c013d78d41de2733d0f4be015..e0a91d93d03bf5e1b094317c178969e1ef2841b7 100644
--- a/pkg/analyzer/lib/dart/element/element.dart
+++ b/pkg/analyzer/lib/dart/element/element.dart
@@ -806,6 +806,13 @@ abstract class ElementAnnotation implements ConstantEvaluationTarget {
DartObject get constantValue;
/**
+ * Return a representation of the value of this annotation, forcing the value
+ * to be computed if it had not previously been computed, or `null` if the
+ * value of this annotation could not be computed because of errors.
+ */
+ DartObject computeConstantValue();
+
+ /**
* Return the element representing the field, variable, or const constructor
* being used as an annotation.
*/
@@ -1931,6 +1938,14 @@ abstract class VariableElement implements Element, ConstantEvaluationTarget {
DartObject get constantValue;
/**
+ * Return a representation of the value of this variable, forcing the value
+ * to be computed if it had not previously been computed, or `null` if either
+ * this variable was not declared with the 'const' modifier or if the value of
+ * this variable could not be computed because of errors.
+ */
+ DartObject computeConstantValue();
+
+ /**
* Return `true` if this variable element did not have an explicit type
* specified for it.
*/
« 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