| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 library docgen.model_helpers; | 5 library docgen.model_helpers; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 | 8 |
| 9 import 'package:compiler/src/constants/expressions.dart'; | 9 import 'package:compiler/src/constants/expressions.dart'; |
| 10 | 10 |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 var mirror = | 89 var mirror = |
| 90 dart2js_mirrors.BackDoor.getMirrorFromElement(context.mirror, element); | 90 dart2js_mirrors.BackDoor.getMirrorFromElement(context.mirror, element); |
| 91 if (mirror != null) { | 91 if (mirror != null) { |
| 92 return new Annotation(context.owningLibrary, mirror, parameters); | 92 return new Annotation(context.owningLibrary, mirror, parameters); |
| 93 } | 93 } |
| 94 return null; | 94 return null; |
| 95 } | 95 } |
| 96 | 96 |
| 97 @override | 97 @override |
| 98 Annotation visitBinary(BinaryConstantExpression exp, | 98 Annotation visitBinary(BinaryConstantExpression exp, |
| 99 [AnnotationInfo context]) { | 99 AnnotationInfo context) { |
| 100 return null; | 100 return null; |
| 101 } | 101 } |
| 102 | 102 |
| 103 @override | 103 @override |
| 104 Annotation visitConcatenate(ConcatenateConstantExpression exp, | 104 Annotation visitConcatenate(ConcatenateConstantExpression exp, |
| 105 [AnnotationInfo context]) { | 105 AnnotationInfo context) { |
| 106 return null; | 106 return null; |
| 107 } | 107 } |
| 108 | 108 |
| 109 @override | 109 @override |
| 110 Annotation visitConditional(ConditionalConstantExpression exp, | 110 Annotation visitConditional(ConditionalConstantExpression exp, |
| 111 [AnnotationInfo context]) { | 111 AnnotationInfo context) { |
| 112 return null; | 112 return null; |
| 113 } | 113 } |
| 114 | 114 |
| 115 @override | 115 @override |
| 116 Annotation visitConstructed(ConstructedConstantExpresssion exp, | 116 Annotation visitConstructed(ConstructedConstantExpresssion exp, |
| 117 [AnnotationInfo context]) { | 117 AnnotationInfo context) { |
| 118 return createAnnotation(exp.target, context, | 118 return createAnnotation(exp.target, context, |
| 119 exp.arguments.map((a) => a.getText()).toList()); | 119 exp.arguments.map((a) => a.getText()).toList()); |
| 120 } | 120 } |
| 121 | 121 |
| 122 @override | 122 @override |
| 123 Annotation visitFunction(FunctionConstantExpression exp, | 123 Annotation visitFunction(FunctionConstantExpression exp, |
| 124 [AnnotationInfo context]) { | 124 AnnotationInfo context) { |
| 125 return createAnnotation(exp.element, context); | 125 return createAnnotation(exp.element, context); |
| 126 } | 126 } |
| 127 | 127 |
| 128 @override | 128 @override |
| 129 Annotation visitList(ListConstantExpression exp, | 129 Annotation visitList(ListConstantExpression exp, |
| 130 [AnnotationInfo context]) { | 130 AnnotationInfo context) { |
| 131 return null; | 131 return null; |
| 132 } | 132 } |
| 133 | 133 |
| 134 @override | 134 @override |
| 135 Annotation visitMap(MapConstantExpression exp, | 135 Annotation visitMap(MapConstantExpression exp, |
| 136 [AnnotationInfo context]) { | 136 AnnotationInfo context) { |
| 137 return null; | 137 return null; |
| 138 } | 138 } |
| 139 | 139 |
| 140 @override | 140 @override |
| 141 Annotation visitPrimitive(PrimitiveConstantExpression exp, | 141 Annotation visitPrimitive(PrimitiveConstantExpression exp, |
| 142 [AnnotationInfo context]) { | 142 AnnotationInfo context) { |
| 143 return null; | 143 return null; |
| 144 } | 144 } |
| 145 | 145 |
| 146 @override | 146 @override |
| 147 Annotation visitSymbol(SymbolConstantExpression exp, | 147 Annotation visitSymbol(SymbolConstantExpression exp, |
| 148 [AnnotationInfo context]) { | 148 AnnotationInfo context) { |
| 149 return null; | 149 return null; |
| 150 } | 150 } |
| 151 | 151 |
| 152 @override | 152 @override |
| 153 Annotation visitType(TypeConstantExpression exp, | 153 Annotation visitType(TypeConstantExpression exp, |
| 154 [AnnotationInfo context]) { | 154 AnnotationInfo context) { |
| 155 return null; | 155 return null; |
| 156 } | 156 } |
| 157 | 157 |
| 158 @override | 158 @override |
| 159 Annotation visitUnary(UnaryConstantExpression exp, | 159 Annotation visitUnary(UnaryConstantExpression exp, |
| 160 [AnnotationInfo context]) { | 160 AnnotationInfo context) { |
| 161 return null; | 161 return null; |
| 162 } | 162 } |
| 163 | 163 |
| 164 @override | 164 @override |
| 165 Annotation visitVariable(VariableConstantExpression exp, | 165 Annotation visitVariable(VariableConstantExpression exp, |
| 166 [AnnotationInfo context]) { | 166 AnnotationInfo context) { |
| 167 return createAnnotation(exp.element, context); | 167 return createAnnotation(exp.element, context); |
| 168 } | 168 } |
| 169 } | 169 } |
| 170 | 170 |
| 171 /// A declaration is private if itself is private, or the owner is private. | 171 /// A declaration is private if itself is private, or the owner is private. |
| 172 bool isHidden(DeclarationSourceMirror mirror) { | 172 bool isHidden(DeclarationSourceMirror mirror) { |
| 173 if (mirror is LibraryMirror) { | 173 if (mirror is LibraryMirror) { |
| 174 return _isLibraryPrivate(mirror); | 174 return _isLibraryPrivate(mirror); |
| 175 } else if (mirror.owner is LibraryMirror) { | 175 } else if (mirror.owner is LibraryMirror) { |
| 176 return (mirror.isPrivate || _isLibraryPrivate(mirror.owner) || | 176 return (mirror.isPrivate || _isLibraryPrivate(mirror.owner) || |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 // the time. | 359 // the time. |
| 360 var sdkLibrary = LIBRARIES[dart2js_util.nameOf(mirror)]; | 360 var sdkLibrary = LIBRARIES[dart2js_util.nameOf(mirror)]; |
| 361 if (sdkLibrary != null) { | 361 if (sdkLibrary != null) { |
| 362 return !sdkLibrary.documented; | 362 return !sdkLibrary.documented; |
| 363 } else if (dart2js_util.nameOf(mirror).startsWith('_') || dart2js_util.nameOf( | 363 } else if (dart2js_util.nameOf(mirror).startsWith('_') || dart2js_util.nameOf( |
| 364 mirror).contains('._')) { | 364 mirror).contains('._')) { |
| 365 return true; | 365 return true; |
| 366 } | 366 } |
| 367 return false; | 367 return false; |
| 368 } | 368 } |
| OLD | NEW |