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

Side by Side Diff: lib/src/js/printer.dart

Issue 1530563003: Generate all runtime files from dart. (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years 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
« no previous file with comments | « lib/src/codegen/js_interop.dart ('k') | lib/src/js/template.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 part of js_ast; 5 part of js_ast;
6 6
7 7
8 class JavaScriptPrintingOptions { 8 class JavaScriptPrintingOptions {
9 final bool shouldCompressOutput; 9 final bool shouldCompressOutput;
10 final bool minifyLocalVariables; 10 final bool minifyLocalVariables;
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 if (shouldCompressOutput) { 174 if (shouldCompressOutput) {
175 pendingSemicolon = true; 175 pendingSemicolon = true;
176 } else { 176 } else {
177 out(";"); 177 out(";");
178 forceLine(); 178 forceLine();
179 } 179 }
180 } 180 }
181 181
182 void outIndent(String str) { indent(); out(str); } 182 void outIndent(String str) { indent(); out(str); }
183 void outIndentLn(String str) { indent(); outLn(str); } 183 void outIndentLn(String str) { indent(); outLn(str); }
184
184 void indent() { 185 void indent() {
185 if (!shouldCompressOutput) { 186 if (!shouldCompressOutput) {
186 out(indentation); 187 out(indentation);
187 } 188 }
188 } 189 }
189 190
190 visit(Node node) { 191 visit(Node node) {
191 context.enterNode(node); 192 context.enterNode(node);
192 node.accept(this); 193 node.accept(this);
193 context.exitNode(node); 194 context.exitNode(node);
(...skipping 1414 matching lines...) Expand 10 before | Expand all | Expand 10 after
1608 declare(node.name); 1609 declare(node.name);
1609 node.function.accept(this); 1610 node.function.accept(this);
1610 } 1611 }
1611 1612
1612 visitClassExpression(ClassExpression node) { 1613 visitClassExpression(ClassExpression node) {
1613 declare(node.name); 1614 declare(node.name);
1614 if (node.heritage != null) node.heritage.accept(this); 1615 if (node.heritage != null) node.heritage.accept(this);
1615 for (Method element in node.methods) element.accept(this); 1616 for (Method element in node.methods) element.accept(this);
1616 } 1617 }
1617 } 1618 }
OLDNEW
« no previous file with comments | « lib/src/codegen/js_interop.dart ('k') | lib/src/js/template.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698