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

Unified Diff: pkg/compiler/lib/src/elements/modelx.dart

Issue 1892093003: Support deserialized compilation of the empty program. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments Created 4 years, 8 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
Index: pkg/compiler/lib/src/elements/modelx.dart
diff --git a/pkg/compiler/lib/src/elements/modelx.dart b/pkg/compiler/lib/src/elements/modelx.dart
index 2e462f4dca7f97f96ff7cc910b4bf3576e9b4060..10c2f71197648518ef2e5fd429b0b53275c055c0 100644
--- a/pkg/compiler/lib/src/elements/modelx.dart
+++ b/pkg/compiler/lib/src/elements/modelx.dart
@@ -3268,7 +3268,15 @@ abstract class AstElementMixin implements AstElement {
}
ResolvedAst get resolvedAst {
+ Node node = definingElement.node;
+ Node body;
+ if (definingElement.isField) {
+ FieldElement field = definingElement;
+ body = field.initializer;
+ } else if (node != null && node.asFunctionExpression() != null) {
+ body = node.asFunctionExpression().body;
+ }
return new ParsedResolvedAst(
- declaration, definingElement.node, definingElement.treeElements);
+ declaration, node, body, definingElement.treeElements);
}
}

Powered by Google App Engine
This is Rietveld 408576698