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

Unified Diff: pkg/compiler/lib/src/compile_time_constants.dart

Issue 2935663002: Remove Compiler.commonElements (Closed)
Patch Set: Remove Compiler._commonElements Created 3 years, 6 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 | « pkg/compiler/lib/src/closure.dart ('k') | pkg/compiler/lib/src/compiler.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/compile_time_constants.dart
diff --git a/pkg/compiler/lib/src/compile_time_constants.dart b/pkg/compiler/lib/src/compile_time_constants.dart
index b6ed55131a6ae3de6a371e0f361aa44dd490f0ea..02576e09e63bb4c136a049b0d1aa5246b78682e1 100644
--- a/pkg/compiler/lib/src/compile_time_constants.dart
+++ b/pkg/compiler/lib/src/compile_time_constants.dart
@@ -161,7 +161,7 @@ abstract class ConstantCompilerBase implements ConstantCompiler {
DiagnosticReporter get reporter => compiler.reporter;
- CommonElements get commonElements => compiler.commonElements;
+ CommonElements get commonElements => compiler.resolution.commonElements;
@override
@deprecated
@@ -406,7 +406,7 @@ class CompileTimeConstantEvaluator extends Visitor<AstConstant> {
ConstantSystem get constantSystem => handler.constantSystem;
Resolution get resolution => compiler.resolution;
- CommonElements get commonElements => compiler.commonElements;
+ CommonElements get commonElements => resolution.commonElements;
DiagnosticReporter get reporter => compiler.reporter;
AstConstant evaluate(Node node) {
@@ -513,7 +513,7 @@ class CompileTimeConstantEvaluator extends Visitor<AstConstant> {
node,
new MapConstantExpression(type, keyExpressions, valueExpressions),
constantSystem.createMap(
- compiler.commonElements, type, keyValues, map.values.toList()));
+ resolution.commonElements, type, keyValues, map.values.toList()));
}
AstConstant visitLiteralNull(LiteralNull node) {
@@ -592,7 +592,7 @@ class CompileTimeConstantEvaluator extends Visitor<AstConstant> {
constantSystem.createString(text))
];
ConstructorElement constructor =
- compiler.commonElements.symbolConstructorTarget;
+ resolution.commonElements.symbolConstructorTarget;
AstConstant constant = createConstructorInvocation(
node, type, constructor, CallStructure.ONE_ARG,
normalizedArguments: arguments);
@@ -601,7 +601,7 @@ class CompileTimeConstantEvaluator extends Visitor<AstConstant> {
}
ConstantValue makeTypeConstant(ResolutionDartType elementType) {
- return constantSystem.createType(compiler.commonElements, elementType);
+ return constantSystem.createType(resolution.commonElements, elementType);
}
/// Returns true if the prefix of the send resolves to a deferred import
@@ -707,7 +707,7 @@ class CompileTimeConstantEvaluator extends Visitor<AstConstant> {
}
return result;
} else if (send.isCall) {
- if (element == compiler.commonElements.identicalFunction &&
+ if (element == resolution.commonElements.identicalFunction &&
send.argumentCount() == 2) {
AstConstant left = evaluate(send.argumentsNode.nodes.head);
AstConstant right = evaluate(send.argumentsNode.nodes.tail.head);
@@ -1450,7 +1450,7 @@ class _CompilerEnvironment implements EvaluationEnvironment {
_CompilerEnvironment(this._compiler);
@override
- CommonElements get commonElements => _compiler.commonElements;
+ CommonElements get commonElements => _compiler.resolution.commonElements;
@override
String readFromEnvironment(String name) {
« no previous file with comments | « pkg/compiler/lib/src/closure.dart ('k') | pkg/compiler/lib/src/compiler.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698