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

Side by Side Diff: pkg/compiler/lib/src/js_emitter/old_emitter/emitter.dart

Issue 1077123002: dart2js: Add newline in minified mode. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 8 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 | « no previous file | no next file » | 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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 part of dart2js.js_emitter; 5 part of dart2js.js_emitter;
6 6
7 7
8 class OldEmitter implements Emitter { 8 class OldEmitter implements Emitter {
9 final Compiler compiler; 9 final Compiler compiler;
10 final CodeEmitterTask task; 10 final CodeEmitterTask task;
(...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after
637 constructList(program.metadata)]), 637 constructList(program.metadata)]),
638 js.statement('# = #;', [typesAccess, constructList(types)])]), 638 js.statement('# = #;', [typesAccess, constructList(types)])]),
639 compiler, monitor: compiler.dumpInfoTask)); 639 compiler, monitor: compiler.dumpInfoTask));
640 output.add(n); 640 output.add(n);
641 } else if (types != null) { 641 } else if (types != null) {
642 output.addBuffer( 642 output.addBuffer(
643 jsAst.prettyPrint( 643 jsAst.prettyPrint(
644 js.statement('var ${namer.deferredTypesName} = #;', 644 js.statement('var ${namer.deferredTypesName} = #;',
645 constructList(types)), 645 constructList(types)),
646 compiler, monitor: compiler.dumpInfoTask)); 646 compiler, monitor: compiler.dumpInfoTask));
647 output.add(n); 647 if (compiler.enableMinification) {
648 output.add('\n');
herhut 2015/04/10 13:01:57 How about output.add(N)? That will turn into ";\n"
zarah 2015/04/10 13:05:54 No, then in minified mode there will be two ';'s.
zarah 2015/04/10 13:20:24 sorry, non-minified, just for the record.
649 }
648 } 650 }
649 } 651 }
650 652
651 void emitCompileTimeConstants(CodeOutput output, 653 void emitCompileTimeConstants(CodeOutput output,
652 List<Constant> constants, 654 List<Constant> constants,
653 {bool isMainFragment}) { 655 {bool isMainFragment}) {
654 assert(isMainFragment != null); 656 assert(isMainFragment != null);
655 657
656 if (constants.isEmpty) return; 658 if (constants.isEmpty) return;
657 CodeOutput constantOutput = output; 659 CodeOutput constantOutput = output;
(...skipping 1216 matching lines...) Expand 10 before | Expand all | Expand 10 after
1874 for (Element element in compiler.enqueuer.codegen.newlyEnqueuedElements) { 1876 for (Element element in compiler.enqueuer.codegen.newlyEnqueuedElements) {
1875 if (element.isInstanceMember) { 1877 if (element.isInstanceMember) {
1876 cachedClassBuilders.remove(element.enclosingClass); 1878 cachedClassBuilders.remove(element.enclosingClass);
1877 1879
1878 nativeEmitter.cachedBuilders.remove(element.enclosingClass); 1880 nativeEmitter.cachedBuilders.remove(element.enclosingClass);
1879 1881
1880 } 1882 }
1881 } 1883 }
1882 } 1884 }
1883 } 1885 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698