| 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 763 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 774 default: | 774 default: |
| 775 out(op); | 775 out(op); |
| 776 } | 776 } |
| 777 visitNestedExpression(unary.argument, unary.precedenceLevel, | 777 visitNestedExpression(unary.argument, unary.precedenceLevel, |
| 778 newInForInit: inForInit, newAtStatementBegin: false); | 778 newInForInit: inForInit, newAtStatementBegin: false); |
| 779 } | 779 } |
| 780 | 780 |
| 781 visitSpread(Spread unary) => visitPrefix(unary); | 781 visitSpread(Spread unary) => visitPrefix(unary); |
| 782 | 782 |
| 783 visitYield(Yield yield) { | 783 visitYield(Yield yield) { |
| 784 out(yield.star ? "yield* " : "yield "); | 784 out(yield.star ? "yield*" : "yield"); |
| 785 if (yield.value == null) return; |
| 786 out(" "); |
| 785 visitNestedExpression(yield.value, yield.precedenceLevel, | 787 visitNestedExpression(yield.value, yield.precedenceLevel, |
| 786 newInForInit: inForInit, newAtStatementBegin: false); | 788 newInForInit: inForInit, newAtStatementBegin: false); |
| 787 } | 789 } |
| 788 | 790 |
| 789 visitPostfix(Postfix postfix) { | 791 visitPostfix(Postfix postfix) { |
| 790 visitNestedExpression(postfix.argument, LEFT_HAND_SIDE, | 792 visitNestedExpression(postfix.argument, LEFT_HAND_SIDE, |
| 791 newInForInit: inForInit, | 793 newInForInit: inForInit, |
| 792 newAtStatementBegin: atStatementBegin); | 794 newAtStatementBegin: atStatementBegin); |
| 793 out(postfix.op); | 795 out(postfix.op); |
| 794 } | 796 } |
| (...skipping 681 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1476 declare(node.name); | 1478 declare(node.name); |
| 1477 node.function.accept(this); | 1479 node.function.accept(this); |
| 1478 } | 1480 } |
| 1479 | 1481 |
| 1480 visitClassExpression(ClassExpression node) { | 1482 visitClassExpression(ClassExpression node) { |
| 1481 declare(node.name); | 1483 declare(node.name); |
| 1482 if (node.heritage != null) node.heritage.accept(this); | 1484 if (node.heritage != null) node.heritage.accept(this); |
| 1483 for (Method element in node.methods) element.accept(this); | 1485 for (Method element in node.methods) element.accept(this); |
| 1484 } | 1486 } |
| 1485 } | 1487 } |
| OLD | NEW |