| 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 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 } else { | 231 } else { |
| 232 lineOut(); | 232 lineOut(); |
| 233 } | 233 } |
| 234 indentMore(); | 234 indentMore(); |
| 235 visit(body); | 235 visit(body); |
| 236 indentLess(); | 236 indentLess(); |
| 237 return false; | 237 return false; |
| 238 } | 238 } |
| 239 | 239 |
| 240 void blockOutWithoutBraces(Node node) { | 240 void blockOutWithoutBraces(Node node) { |
| 241 if (node is Block) { | 241 if (node is Block && !node.isScope) { |
| 242 context.enterNode(node); | 242 context.enterNode(node); |
| 243 Block block = node; | 243 Block block = node; |
| 244 block.statements.forEach(blockOutWithoutBraces); | 244 block.statements.forEach(blockOutWithoutBraces); |
| 245 context.exitNode(node); | 245 context.exitNode(node); |
| 246 } else { | 246 } else { |
| 247 visit(node); | 247 visit(node); |
| 248 } | 248 } |
| 249 } | 249 } |
| 250 | 250 |
| 251 void blockOut(Block node, bool shouldIndent, bool needsNewline) { | 251 void blockOut(Block node, bool shouldIndent, bool needsNewline) { |
| (...skipping 1245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1497 declare(node.name); | 1497 declare(node.name); |
| 1498 node.function.accept(this); | 1498 node.function.accept(this); |
| 1499 } | 1499 } |
| 1500 | 1500 |
| 1501 visitClassExpression(ClassExpression node) { | 1501 visitClassExpression(ClassExpression node) { |
| 1502 declare(node.name); | 1502 declare(node.name); |
| 1503 if (node.heritage != null) node.heritage.accept(this); | 1503 if (node.heritage != null) node.heritage.accept(this); |
| 1504 for (Method element in node.methods) element.accept(this); | 1504 for (Method element in node.methods) element.accept(this); |
| 1505 } | 1505 } |
| 1506 } | 1506 } |
| OLD | NEW |