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

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

Issue 1036723002: Move "null2" getter from ConstantVisitor to TypeProvider. (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 | pkg/analyzer/lib/src/generated/resolver.dart » ('j') | 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 ec180c59d01fa30705273543fb9c9540fbd3cef7..c5b413d06cd8ea9387aa32f0e97afcc8f3410a6e 100644
--- a/pkg/analyzer/lib/src/generated/constant.dart
+++ b/pkg/analyzer/lib/src/generated/constant.dart
@@ -757,7 +757,7 @@ class ConstantValueComputer {
namedArgumentValues[name] =
constantVisitor._valueOf(argument.expression);
namedArgumentNodes[name] = argument;
- argumentValues[i] = constantVisitor.null2;
+ argumentValues[i] = typeProvider.nullObject;
} else {
argumentValues[i] = constantVisitor._valueOf(argument);
argumentNodes[i] = argument;
@@ -868,7 +868,7 @@ class ConstantValueComputer {
EvaluationResultImpl evaluationResult = baseParameter.evaluationResult;
if (evaluationResult == null) {
// No default was provided, so the default value is null.
- argumentValue = constantVisitor.null2;
+ argumentValue = typeProvider.nullObject;
} else if (evaluationResult.value != null) {
argumentValue = evaluationResult.value;
}
@@ -1165,11 +1165,6 @@ class ConstantVisitor extends UnifyingAstVisitor<DartObjectImpl> {
*/
final TypeProvider _typeProvider;
- /**
- * An shared object representing the value 'null'.
- */
- DartObjectImpl _nullObject;
-
HashMap<String, DartObjectImpl> _lexicalEnvironment;
/**
@@ -1209,17 +1204,6 @@ class ConstantVisitor extends UnifyingAstVisitor<DartObjectImpl> {
}
/**
- * Return an object representing the value 'null'.
- */
- DartObjectImpl get null2 {
- if (_nullObject == null) {
- _nullObject =
- new DartObjectImpl(_typeProvider.nullType, NullState.NULL_STATE);
- }
- return _nullObject;
- }
-
- /**
* This method is called just before retrieving an evaluation result from an
* AST node. Unit tests will override it to introduce additional error
* checking.
@@ -1504,7 +1488,7 @@ class ConstantVisitor extends UnifyingAstVisitor<DartObjectImpl> {
}
@override
- DartObjectImpl visitNullLiteral(NullLiteral node) => null2;
+ DartObjectImpl visitNullLiteral(NullLiteral node) => _typeProvider.nullObject;
@override
DartObjectImpl visitParenthesizedExpression(ParenthesizedExpression node) =>
@@ -1677,7 +1661,7 @@ class ConstantVisitor extends UnifyingAstVisitor<DartObjectImpl> {
if (expressionValue != null) {
return expressionValue;
}
- return null2;
+ return _typeProvider.nullObject;
}
}
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/generated/resolver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698