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

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

Issue 1383503002: Add Resolution and Parsing interfaces for computeType, ensureResolved and parseNode. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Add TODOs. Created 5 years, 3 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/common/resolution.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 dba9976d7811bf7dc5fda1e57561a437e88a79ba..a9776490f4b075942d463503bc298f84a9d4827a 100644
--- a/pkg/compiler/lib/src/compile_time_constants.dart
+++ b/pkg/compiler/lib/src/compile_time_constants.dart
@@ -4,6 +4,8 @@
library dart2js.compile_time_constant_evaluator;
+import 'common/resolution.dart' show
+ Resolution;
import 'common/tasks.dart' show
CompilerTask;
import 'compiler.dart' show
@@ -366,6 +368,7 @@ class CompileTimeConstantEvaluator extends Visitor<AstConstant> {
: this.isEvaluatingConstant = isConst;
ConstantSystem get constantSystem => handler.constantSystem;
+ Resolution get resolution => compiler.resolution;
AstConstant evaluate(Node node) {
// TODO(johnniwinther): should there be a visitErrorNode?
@@ -573,7 +576,7 @@ class CompileTimeConstantEvaluator extends Visitor<AstConstant> {
AstConstant result;
if (Elements.isStaticOrTopLevelFunction(element)) {
FunctionElementX function = element;
- function.computeType(compiler);
+ function.computeType(resolution);
result = new AstConstant(context, send,
new FunctionConstantExpression(function),
new FunctionConstantValue(function));
@@ -766,7 +769,7 @@ class CompileTimeConstantEvaluator extends Visitor<AstConstant> {
return new AstConstant.fromDefaultValue(
element, constant, handler.getConstantValue(constant));
}
- target.computeType(compiler);
+ target.computeType(resolution);
FunctionSignature signature = target.functionSignature;
if (!callStructure.signatureApplies(signature)) {
« no previous file with comments | « pkg/compiler/lib/src/common/resolution.dart ('k') | pkg/compiler/lib/src/compiler.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698