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 754 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
765 default: | 765 default: |
766 out(op); | 766 out(op); |
767 } | 767 } |
768 visitNestedExpression(unary.argument, unary.precedenceLevel, | 768 visitNestedExpression(unary.argument, unary.precedenceLevel, |
769 newInForInit: inForInit, newAtStatementBegin: false); | 769 newInForInit: inForInit, newAtStatementBegin: false); |
770 } | 770 } |
771 | 771 |
772 visitSpread(Spread unary) => visitPrefix(unary); | 772 visitSpread(Spread unary) => visitPrefix(unary); |
773 | 773 |
774 visitYield(Yield yield) { | 774 visitYield(Yield yield) { |
775 out(yield.star ? "yield* " : "yield "); | 775 out(yield.star ? "yield*" : "yield"); |
| 776 if (yield.value == null) return; |
| 777 out(" "); |
776 visitNestedExpression(yield.value, yield.precedenceLevel, | 778 visitNestedExpression(yield.value, yield.precedenceLevel, |
777 newInForInit: inForInit, newAtStatementBegin: false); | 779 newInForInit: inForInit, newAtStatementBegin: false); |
778 } | 780 } |
779 | 781 |
780 visitPostfix(Postfix postfix) { | 782 visitPostfix(Postfix postfix) { |
781 visitNestedExpression(postfix.argument, LEFT_HAND_SIDE, | 783 visitNestedExpression(postfix.argument, LEFT_HAND_SIDE, |
782 newInForInit: inForInit, | 784 newInForInit: inForInit, |
783 newAtStatementBegin: atStatementBegin); | 785 newAtStatementBegin: atStatementBegin); |
784 out(postfix.op); | 786 out(postfix.op); |
785 } | 787 } |
(...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1460 declare(node.name); | 1462 declare(node.name); |
1461 node.function.accept(this); | 1463 node.function.accept(this); |
1462 } | 1464 } |
1463 | 1465 |
1464 visitClassExpression(ClassExpression node) { | 1466 visitClassExpression(ClassExpression node) { |
1465 declare(node.name); | 1467 declare(node.name); |
1466 if (node.heritage != null) node.heritage.accept(this); | 1468 if (node.heritage != null) node.heritage.accept(this); |
1467 for (Method element in node.methods) element.accept(this); | 1469 for (Method element in node.methods) element.accept(this); |
1468 } | 1470 } |
1469 } | 1471 } |
OLD | NEW |