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

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

Issue 10891004: [dart2dart] Optionally cut types in variable declarations: (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 4 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: lib/compiler/implementation/dart_backend/renamer.dart
diff --git a/lib/compiler/implementation/dart_backend/renamer.dart b/lib/compiler/implementation/dart_backend/renamer.dart
index a3274732b78faa48f7b08734d014ec03a156d33c..8c1f5f3627ed1d946f63a63b36e4c5939774a76a 100644
--- a/lib/compiler/implementation/dart_backend/renamer.dart
+++ b/lib/compiler/implementation/dart_backend/renamer.dart
@@ -11,7 +11,8 @@ void renamePlaceholders(
PlaceholderCollector placeholderCollector,
Map<Node, String> renames,
Map<LibraryElement, String> imports,
- bool minify) {
+ bool minify,
+ bool cutDeclarationTypes) {
final Map<LibraryElement, Map<String, String>> renamed
= new Map<LibraryElement, Map<String, String>>();
final Set<String> usedTopLevelIdentifiers = new Set<String>();
@@ -100,6 +101,12 @@ void renamePlaceholders(
sortedForEach(placeholderCollector.privateNodes, (library, nodes) {
renameNodes(nodes, (node) => rename(library, node.source.slowToString()));
});
+ if (cutDeclarationTypes) {
+ for (DeclarationTypePlaceholder placeholder in
+ placeholderCollector.declarationTypePlaceholders) {
+ renames[placeholder.typeNode] = placeholder.requiresVar ? 'var' : '';
+ }
+ }
}
typedef String Generator(String originalName, bool isForbidden(String name));

Powered by Google App Engine
This is Rietveld 408576698