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

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

Issue 10875040: Support customizing API (and hence mock) compiler to minify the output. (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
« no previous file with comments | « lib/compiler/implementation/dart_backend/backend.dart ('k') | 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/renamer.dart
diff --git a/lib/compiler/implementation/dart_backend/renamer.dart b/lib/compiler/implementation/dart_backend/renamer.dart
index 959f8d8994c16a1a6b9212754d698a7f79176a5d..e675506491585597c4cabd8be0733c449b44210c 100644
--- a/lib/compiler/implementation/dart_backend/renamer.dart
+++ b/lib/compiler/implementation/dart_backend/renamer.dart
@@ -10,7 +10,8 @@ void renamePlaceholders(
Compiler compiler,
PlaceholderCollector placeholderCollector,
Map<Node, String> renames,
- Map<LibraryElement, String> imports) {
+ Map<LibraryElement, String> imports,
+ bool minify) {
final Map<LibraryElement, Map<String, String>> renamed
= new Map<LibraryElement, Map<String, String>>();
final Set<String> usedTopLevelIdentifiers = new Set<String>();
@@ -19,7 +20,7 @@ void renamePlaceholders(
usedTopLevelIdentifiers.add('main'); // Never rename anything to 'main'.
Generator topLevelGenerator =
- true ? conservativeGenerator : new MinifyingGenerator('ABCD').generate;
+ minify ? new MinifyingGenerator('ABCD').generate : conservativeGenerator;
String generateUniqueName(name) {
String newName = topLevelGenerator(
name, usedTopLevelIdentifiers.contains);
« no previous file with comments | « lib/compiler/implementation/dart_backend/backend.dart ('k') | tests/compiler/dart2js/unparser_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698