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

Unified Diff: pkg/analyzer/lib/src/generated/constant.dart

Issue 1055543003: Rename ConstantValueComputer_InitializerCloner. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 9 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/generated/constant.dart
diff --git a/pkg/analyzer/lib/src/generated/constant.dart b/pkg/analyzer/lib/src/generated/constant.dart
index 5b400a8c3b8acb86427b9ad31d85976e40cad061..a1a51fe7067723340ad2111ff4c6c792402c2a70 100644
--- a/pkg/analyzer/lib/src/generated/constant.dart
+++ b/pkg/analyzer/lib/src/generated/constant.dart
@@ -144,6 +144,51 @@ class BoolState extends InstanceState {
}
/**
+ * An [AstCloner] that copies the necessary information from the AST to allow
+ * const constructor initializers to be evaluated.
+ */
+class ConstantAstCloner extends AstCloner {
+ // TODO(brianwilkerson) Investigate replacing uses of this class with uses of
Brian Wilkerson 2015/04/01 16:39:21 I think we can remove the TODO: having one visitor
Paul Berry 2015/04/01 18:12:07 Done.
+ // AstCloner and ResolutionCopier.
+
+ ConstantAstCloner() : super(true);
+
+ @override
+ InstanceCreationExpression visitInstanceCreationExpression(
+ InstanceCreationExpression node) {
+ InstanceCreationExpression expression =
+ super.visitInstanceCreationExpression(node);
+ expression.evaluationResult = node.evaluationResult;
+ return expression;
+ }
+
+ @override
+ RedirectingConstructorInvocation visitRedirectingConstructorInvocation(
+ RedirectingConstructorInvocation node) {
+ RedirectingConstructorInvocation invocation =
+ super.visitRedirectingConstructorInvocation(node);
+ invocation.staticElement = node.staticElement;
+ return invocation;
+ }
+
+ @override
+ SimpleIdentifier visitSimpleIdentifier(SimpleIdentifier node) {
+ SimpleIdentifier identifier = super.visitSimpleIdentifier(node);
+ identifier.staticElement = node.staticElement;
+ return identifier;
+ }
+
+ @override
+ SuperConstructorInvocation visitSuperConstructorInvocation(
+ SuperConstructorInvocation node) {
+ SuperConstructorInvocation invocation =
+ super.visitSuperConstructorInvocation(node);
+ invocation.staticElement = node.staticElement;
+ return invocation;
+ }
+}
+
+/**
* Instances of the class `ConstantEvaluator` evaluate constant expressions to
* produce their compile-time value. According to the Dart Language
* Specification:
@@ -652,8 +697,7 @@ class ConstantValueComputer {
ConstructorElementImpl constructor =
declaration.element as ConstructorElementImpl;
constructor.constantInitializers =
- new ConstantValueComputer_InitializerCloner()
- .cloneNodeList(initializers);
+ new ConstantAstCloner().cloneNodeList(initializers);
} else if (constNode is FormalParameter) {
if (constNode is DefaultFormalParameter) {
DefaultFormalParameter parameter = constNode;
@@ -1089,51 +1133,6 @@ class ConstantValueComputer {
}
/**
- * An [AstCloner] that copies the necessary information from the AST to allow
- * const constructor initializers to be evaluated.
- */
-class ConstantValueComputer_InitializerCloner extends AstCloner {
- // TODO(brianwilkerson) Investigate replacing uses of this class with uses of
- // AstCloner and ResolutionCopier.
-
- ConstantValueComputer_InitializerCloner() : super(true);
-
- @override
- InstanceCreationExpression visitInstanceCreationExpression(
- InstanceCreationExpression node) {
- InstanceCreationExpression expression =
- super.visitInstanceCreationExpression(node);
- expression.evaluationResult = node.evaluationResult;
- return expression;
- }
-
- @override
- RedirectingConstructorInvocation visitRedirectingConstructorInvocation(
- RedirectingConstructorInvocation node) {
- RedirectingConstructorInvocation invocation =
- super.visitRedirectingConstructorInvocation(node);
- invocation.staticElement = node.staticElement;
- return invocation;
- }
-
- @override
- SimpleIdentifier visitSimpleIdentifier(SimpleIdentifier node) {
- SimpleIdentifier identifier = super.visitSimpleIdentifier(node);
- identifier.staticElement = node.staticElement;
- return identifier;
- }
-
- @override
- SuperConstructorInvocation visitSuperConstructorInvocation(
- SuperConstructorInvocation node) {
- SuperConstructorInvocation invocation =
- super.visitSuperConstructorInvocation(node);
- invocation.staticElement = node.staticElement;
- return invocation;
- }
-}
-
-/**
* A visitor used to evaluate constant expressions to produce their compile-time
* value. According to the Dart Language Specification: <blockquote> A constant
* expression is one of the following:
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698