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

Side by Side Diff: lib/compiler/implementation/dart_backend/backend.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: Created 8 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « lib/compiler/implementation/dart2js.dart ('k') | lib/compiler/implementation/js/printer.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 class DartBackend extends Backend { 5 class DartBackend extends Backend {
6 final List<CompilerTask> tasks; 6 final List<CompilerTask> tasks;
7 final bool minify; 7 final bool minify;
8 final bool cutDeclarationTypes; 8 final bool cutDeclarationTypes;
9 9
10 Map<Element, TreeElements> get resolvedElements => 10 Map<Element, TreeElements> get resolvedElements =>
11 compiler.enqueuer.resolution.resolvedElements; 11 compiler.enqueuer.resolution.resolvedElements;
12 12
13 DartBackend(Compiler compiler, this.minify, this.cutDeclarationTypes) 13 DartBackend(Compiler compiler, this.cutDeclarationTypes)
14 : tasks = <CompilerTask>[], 14 : tasks = <CompilerTask>[],
15 super(compiler); 15 minify = compiler.enableMinification,
Anton Muhin 2012/08/29 10:29:16 I'd rather add a getter or omit it altogether and
16 super(compiler);
16 17
17 void enqueueHelpers(Enqueuer world) { } 18 void enqueueHelpers(Enqueuer world) { }
18 void codegen(WorkItem work) { } 19 void codegen(WorkItem work) { }
19 void processNativeClasses(Enqueuer world, 20 void processNativeClasses(Enqueuer world,
20 Collection<LibraryElement> libraries) { } 21 Collection<LibraryElement> libraries) { }
21 22
22 void assembleProgram() { 23 void assembleProgram() {
23 /** 24 /**
24 * Tells whether we should output given element. Corelib classes like 25 * Tells whether we should output given element. Corelib classes like
25 * Object should not be in the resulting code. 26 * Object should not be in the resulting code.
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 181
181 List<Element> sortElements(Collection<Element> elements) { 182 List<Element> sortElements(Collection<Element> elements) {
182 compareElements(e0, e1) { 183 compareElements(e0, e1) {
183 int result = compareBy((e) => e.getLibrary().uri.toString())(e0, e1); 184 int result = compareBy((e) => e.getLibrary().uri.toString())(e0, e1);
184 if (result != 0) return result; 185 if (result != 0) return result;
185 return compareBy((e) => e.position().charOffset)(e0, e1); 186 return compareBy((e) => e.position().charOffset)(e0, e1);
186 } 187 }
187 188
188 return sorted(elements, compareElements); 189 return sorted(elements, compareElements);
189 } 190 }
OLDNEW
« no previous file with comments | « lib/compiler/implementation/dart2js.dart ('k') | lib/compiler/implementation/js/printer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698