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

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

Issue 10901002: Hook up the --minify option in dart2js and use it to get rid of unnecessary whitespace inside funct… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Merge. 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') | lib/compiler/implementation/js/printer.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 f944ca524f7da6510bf6517dcb9e9448ccd56c82..bc4a11cc476c19004e95cf4872b696e418bc4129 100644
--- a/lib/compiler/implementation/dart_backend/renamer.dart
+++ b/lib/compiler/implementation/dart_backend/renamer.dart
@@ -12,13 +12,12 @@ void renamePlaceholders(
Map<Node, String> renames,
Map<LibraryElement, String> imports,
Set<String> fixedMemberNames,
- bool minify,
bool cutDeclarationTypes) {
final Map<LibraryElement, Map<String, String>> renamed
= new Map<LibraryElement, Map<String, String>>();
- Generator topLevelGenerator =
- minify ? new MinifyingGenerator('ABCDEFGHIJKLMNOPQRSTUVWXYZ').generate
- : conservativeGenerator;
+ Generator topLevelGenerator = compiler.enableMinification
+ ? new MinifyingGenerator('ABCDEFGHIJKLMNOPQRSTUVWXYZ').generate
+ : conservativeGenerator;
makeGenerator(usedIdentifierSet) => (name) {
String newName = topLevelGenerator(name, usedIdentifierSet.contains);
usedIdentifierSet.add(newName);
@@ -76,9 +75,9 @@ void renamePlaceholders(
sortedForEach(placeholderCollector.functionScopes,
(functionElement, functionScope) {
Set<LocalPlaceholder> placeholders = functionScope.localPlaceholders;
- Generator localGenerator =
- minify ? new MinifyingGenerator('abcdefghijklmnopqrstuvwxyz').generate
- : conservativeGenerator;
+ Generator localGenerator = compiler.enableMinification
+ ? new MinifyingGenerator('abcdefghijklmnopqrstuvwxyz').generate
+ : conservativeGenerator;
Set<String> memberIdentifiers = new Set<String>();
if (functionElement.getEnclosingClass() !== null) {
functionElement.getEnclosingClass().forEachMember(
« no previous file with comments | « lib/compiler/implementation/dart_backend/backend.dart ('k') | lib/compiler/implementation/js/printer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698