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

Unified Diff: lib/compiler/implementation/dart_backend/backend.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/compiler.dart ('k') | lib/compiler/implementation/dart_backend/renamer.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/dart_backend/backend.dart
diff --git a/lib/compiler/implementation/dart_backend/backend.dart b/lib/compiler/implementation/dart_backend/backend.dart
index 173fdefc00c4081cf887d3f47e6628af542f47a6..b2532aac061bcdf382a635803e192a812f8a2249 100644
--- a/lib/compiler/implementation/dart_backend/backend.dart
+++ b/lib/compiler/implementation/dart_backend/backend.dart
@@ -4,11 +4,12 @@
class DartBackend extends Backend {
final List<CompilerTask> tasks;
+ final bool minify;
Map<Element, TreeElements> get resolvedElements =>
compiler.enqueuer.resolution.resolvedElements;
- DartBackend(Compiler compiler)
+ DartBackend(Compiler compiler, this.minify)
: tasks = <CompilerTask>[],
super(compiler);
@@ -101,7 +102,10 @@ class DartBackend extends Backend {
// Create renames.
Map<Node, String> renames = new Map<Node, String>();
Map<LibraryElement, String> imports = new Map<LibraryElement, String>();
- renamePlaceholders(compiler, collector, renames, imports);
+ Generator topLevelGenerator =
Roman 2012/08/24 07:21:04 It is weird that generators are defined in renamer
Roman 2012/08/24 07:27:01 I just thought it would be better to pass the flag
Anton Muhin 2012/08/24 08:42:53 Done.
+ minify ? new MinifyingGenerator('ABCD').generate : conservativeGenerator;
Roman 2012/08/24 07:21:04 80 chars
Anton Muhin 2012/08/24 08:42:53 Now obsolete On 2012/08/24 07:21:04, Roman wrote:
+ renamePlaceholders(
+ compiler, collector, renames, imports, topLevelGenerator);
// Sort elements.
final sortedTopLevels = sortElements(topLevelElements);
« no previous file with comments | « lib/compiler/implementation/compiler.dart ('k') | lib/compiler/implementation/dart_backend/renamer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698