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

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

Issue 1979613002: Use ResolvedAst in constant initializers (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments. 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 | tests/compiler/dart2js/serialization/test_data.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 724e6f669eca41b3b3742ed62d178f622b6ba15a..82cc6de475a33f0a2bab749c9271307236783804 100644
--- a/pkg/compiler/lib/src/compile_time_constants.dart
+++ b/pkg/compiler/lib/src/compile_time_constants.dart
@@ -1187,7 +1187,8 @@ class ConstructorEvaluator extends CompileTimeConstantEvaluator {
* the [fieldValues] map.
*/
void evaluateConstructorInitializers() {
- if (constructor.isSynthesized) {
+ ResolvedAst resolvedAst = constructor.resolvedAst;
+ if (resolvedAst.kind != ResolvedAstKind.PARSED) {
List<AstConstant> compiledArguments = <AstConstant>[];
Function compileArgument = (element) => definitions[element];
@@ -1198,7 +1199,7 @@ class ConstructorEvaluator extends CompileTimeConstantEvaluator {
evaluateSuperOrRedirectSend(compiledArguments, target);
return;
}
- FunctionExpression functionNode = constructor.node;
+ FunctionExpression functionNode = resolvedAst.node;
NodeList initializerList = functionNode.initializers;
bool foundSuperOrRedirect = false;
« no previous file with comments | « no previous file | tests/compiler/dart2js/serialization/test_data.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698