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

Unified Diff: pkg/compiler/lib/src/closure.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
« no previous file with comments | « no previous file | pkg/compiler/lib/src/common/backend_api.dart » ('j') | pkg/compiler/lib/src/compiler.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/closure.dart
diff --git a/pkg/compiler/lib/src/closure.dart b/pkg/compiler/lib/src/closure.dart
index 2b4278a25e45601dffb30c76104a9dad04e2435a..26be76d4d202b2139d987eafcf85217894ea1aca 100644
--- a/pkg/compiler/lib/src/closure.dart
+++ b/pkg/compiler/lib/src/closure.dart
@@ -131,7 +131,7 @@ class ClosureFieldElement extends ElementX
bool get hasResolvedAst => hasTreeElements;
ResolvedAst get resolvedAst {
- return new ParsedResolvedAst(this, null, treeElements);
+ return new ParsedResolvedAst(this, null, null, treeElements);
}
Expression get initializer {
@@ -346,7 +346,7 @@ class SynthesizedCallMethodElementX extends BaseFunctionElementX
FunctionExpression parseNode(Parsing parsing) => node;
ResolvedAst get resolvedAst {
- return new ParsedResolvedAst(this, node, treeElements);
+ return new ParsedResolvedAst(this, node, node.body, treeElements);
}
Element get analyzableElement => closureClass.methodElement.analyzableElement;
@@ -379,6 +379,29 @@ class ClosureScope {
f(LocalVariableElement variable, BoxFieldElement boxField)) {
capturedVariables.forEach(f);
}
+
+ String toString() {
sra1 2016/04/19 03:07:30 I prefer toString() methods to print so that they
Johnni Winther 2016/04/19 07:22:23 Will do in a follow-up.
+ StringBuffer sb = new StringBuffer();
+ if (boxElement != null) {
+ sb.write('box=$boxElement');
+ }
+ if (boxedLoopVariables.isNotEmpty) {
+ if (sb.isNotEmpty) {
+ sb.write(',');
+ }
sra1 2016/04/19 03:07:30 I usually do this like so: var separator = '';
Johnni Winther 2016/04/19 07:22:23 Will do in a follow-up.
+ sb.write('boxedLoopVariables=${boxedLoopVariables}');
+ }
+ if (capturedVariables.isNotEmpty) {
+ if (sb.isNotEmpty) {
+ sb.write(',');
+ }
+ sb.write('capturedVariables=');
+ capturedVariables.forEach((Local local, BoxFieldElement field) {
sra1 2016/04/19 03:07:30 Might as well just print the map.
Johnni Winther 2016/04/19 07:22:23 Some of the default toString implementations print
+ sb.write('$local->${field} ');
+ });
+ }
+ return sb.toString();
+ }
}
class ClosureClassMap {
« no previous file with comments | « no previous file | pkg/compiler/lib/src/common/backend_api.dart » ('j') | pkg/compiler/lib/src/compiler.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698