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

Unified Diff: lib/compiler/implementation/tree/unparser.dart

Issue 10689104: Fix const unparse. Example: (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: add tests 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') | tests/compiler/dart2js/unparser_test.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/tree/unparser.dart
diff --git a/lib/compiler/implementation/tree/unparser.dart b/lib/compiler/implementation/tree/unparser.dart
index 160890e179a476d2331e605ad765b75ac94161aa..fc1d85fdd750e6d6fd46f5d776a0c661d6b44b50 100644
--- a/lib/compiler/implementation/tree/unparser.dart
+++ b/lib/compiler/implementation/tree/unparser.dart
@@ -151,7 +151,9 @@ class Unparser implements Visitor {
}
visitLiteralList(LiteralList node) {
- // TODO(ahe): handle 'const'.
+ if (node.constKeyword !== null) {
+ add(node.constKeyword.value);
+ }
if (node.type !== null) {
sb.add('<');
visit(node.type);
@@ -368,7 +370,9 @@ class Unparser implements Visitor {
}
visitLiteralMap(LiteralMap node) {
- // TODO(ahe): handle 'const'.
+ if (node.constKeyword !== null) {
+ add(node.constKeyword.value);
+ }
if (node.typeArguments !== null) visit(node.typeArguments);
visit(node.entries);
}
« no previous file with comments | « no previous file | tests/compiler/dart2js/unparser_test.dart » ('j') | tests/compiler/dart2js/unparser_test.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698