OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 import '../js/js_ast.dart' as JS show TypeRef, JsTypeRef, ClosureTypePrinter; | 5 import '../js_ast/js_ast.dart' as JS show TypeRef, ClosureTypePrinter; |
6 | 6 |
7 /// Set of closure annotations that can be [toString]ed to a single JsDoc commen
t. | 7 /// Set of closure annotations that can be [toString]ed to a single JsDoc commen
t. |
8 /// See https://developers.google.com/closure/compiler/docs/js-for-compiler | 8 /// See https://developers.google.com/closure/compiler/docs/js-for-compiler |
9 /// | 9 /// |
10 /// TODO(ochafik): Support inclusion of 'normal' comments (including @param comm
ents). | 10 /// TODO(ochafik): Support inclusion of 'normal' comments (including @param comm
ents). |
11 class ClosureAnnotation { | 11 class ClosureAnnotation { |
12 final String comment; | 12 final String comment; |
13 final bool isConst; | 13 final bool isConst; |
14 final bool isConstructor; | 14 final bool isConstructor; |
15 final bool isFinal; | 15 final bool isFinal; |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 if (isNonWildcard(throwsType)) | 125 if (isNonWildcard(throwsType)) |
126 lines.add('@throws {${_print(throwsType)}}'); | 126 lines.add('@throws {${_print(throwsType)}}'); |
127 | 127 |
128 if (lines.length == 0) return ''; | 128 if (lines.length == 0) return ''; |
129 if (lines.length == 1) return '/** ${lines.single} */'; | 129 if (lines.length == 1) return '/** ${lines.single} */'; |
130 __cachedString = '/**\n' + lines.map((l) => ' * $l').join('\n') + '\n */'; | 130 __cachedString = '/**\n' + lines.map((l) => ' * $l').join('\n') + '\n */'; |
131 } | 131 } |
132 return __cachedString; | 132 return __cachedString; |
133 } | 133 } |
134 } | 134 } |
OLD | NEW |