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

Unified Diff: lib/compiler/implementation/dart_backend/emitter.dart

Issue 10689172: Fix incorrect unparse of static/final fields in classes: (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 5 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/unparser_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/dart_backend/emitter.dart
diff --git a/lib/compiler/implementation/dart_backend/emitter.dart b/lib/compiler/implementation/dart_backend/emitter.dart
index bcf72a13af8b4cee94a4dce88d535c8431186f66..dd53d78ea110c720b66688a434a8e09b6d9ed5d4 100644
--- a/lib/compiler/implementation/dart_backend/emitter.dart
+++ b/lib/compiler/implementation/dart_backend/emitter.dart
@@ -7,10 +7,10 @@
*/
class Emitter {
- final DiagnosticListener listener;
+ final Compiler compiler;
final StringBuffer sb;
- Emitter(this.listener) : sb = new StringBuffer();
+ Emitter(this.compiler) : sb = new StringBuffer();
/**
* Outputs given class element with selected inner elements.
@@ -35,22 +35,22 @@ class Emitter {
|| element is AbstractFieldElement) return;
if (element.isField()) {
// Add modifiers first.
- sb.add(element.modifiers.toString());
+ sb.add(element.modifiers.unparse());
sb.add(' ');
// Figure out type.
if (element is VariableElement) {
VariableListElement variables = element.variables;
- if (variables.type !== null) {
+ if (variables.computeType(compiler) !== null) {
sb.add(variables.type);
sb.add(' ');
}
}
// TODO(smok): Maybe not rely on node unparsing,
// but unparse initializer manually.
- sb.add(element.parseNode(listener).unparse());
+ sb.add(element.parseNode(compiler).unparse());
sb.add(';');
} else {
- sb.add(element.parseNode(listener).unparse());
+ sb.add(element.parseNode(compiler).unparse());
}
}
« no previous file with comments | « no previous file | tests/compiler/dart2js/unparser_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698