| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |