| 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 961 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 972 visit(node.classExpr); | 972 visit(node.classExpr); |
| 973 lineOut(); | 973 lineOut(); |
| 974 } | 974 } |
| 975 | 975 |
| 976 visitClassExpression(ClassExpression node) { | 976 visitClassExpression(ClassExpression node) { |
| 977 out('class '); | 977 out('class '); |
| 978 visit(node.name); | 978 visit(node.name); |
| 979 if (node.heritage != null) { | 979 if (node.heritage != null) { |
| 980 out(' extends '); | 980 out(' extends '); |
| 981 visit(node.heritage); | 981 visit(node.heritage); |
| 982 spaceOut(); | |
| 983 } | 982 } |
| 983 spaceOut(); |
| 984 out('{'); | 984 out('{'); |
| 985 lineOut(); | 985 lineOut(); |
| 986 indentMore(); | 986 indentMore(); |
| 987 for (var method in node.methods) { | 987 for (var method in node.methods) { |
| 988 indent(); | 988 indent(); |
| 989 visit(method); | 989 visit(method); |
| 990 lineOut(); | 990 lineOut(); |
| 991 } | 991 } |
| 992 indentLess(); | 992 indentLess(); |
| 993 indent(); | 993 indent(); |
| (...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1405 codes.add(nthLetter((n ~/ nameSpaceSize) % LETTERS)); | 1405 codes.add(nthLetter((n ~/ nameSpaceSize) % LETTERS)); |
| 1406 } | 1406 } |
| 1407 codes.add(charCodes.$0 + digit); | 1407 codes.add(charCodes.$0 + digit); |
| 1408 newName = new String.fromCharCodes(codes); | 1408 newName = new String.fromCharCodes(codes); |
| 1409 } | 1409 } |
| 1410 assert(new RegExp(r'[a-zA-Z][a-zA-Z0-9]*').hasMatch(newName)); | 1410 assert(new RegExp(r'[a-zA-Z][a-zA-Z0-9]*').hasMatch(newName)); |
| 1411 maps.last[oldName] = newName; | 1411 maps.last[oldName] = newName; |
| 1412 return newName; | 1412 return newName; |
| 1413 } | 1413 } |
| 1414 } | 1414 } |
| OLD | NEW |