| 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.models.clazz; | 5 library docgen.models.clazz; |
| 6 | 6 |
| 7 import '../exports/dart2js_mirrors.dart' as dart2js_mirrors; | 7 import '../exports/dart2js_mirrors.dart' as dart2js_mirrors; |
| 8 import '../exports/mirrors_util.dart' as dart2js_util; | 8 import '../exports/mirrors_util.dart' as dart2js_util; |
| 9 import '../exports/source_mirrors.dart'; | 9 import '../exports/source_mirrors.dart'; |
| 10 | 10 |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 // The reason we do this madness is the superclass and interface owners may | 79 // The reason we do this madness is the superclass and interface owners may |
| 80 // not be this class's owner!! Example: BaseClient in http pkg. | 80 // not be this class's owner!! Example: BaseClient in http pkg. |
| 81 var superinterfaces = classMirror.superinterfaces.map( | 81 var superinterfaces = classMirror.superinterfaces.map( |
| 82 (interface) => new Class._possiblyDifferentOwner(interface, owner)); | 82 (interface) => new Class._possiblyDifferentOwner(interface, owner)); |
| 83 this._superclass = classMirror.superclass == null? null : | 83 this._superclass = classMirror.superclass == null? null : |
| 84 new Class._possiblyDifferentOwner(classMirror.superclass, owner); | 84 new Class._possiblyDifferentOwner(classMirror.superclass, owner); |
| 85 | 85 |
| 86 interfaces = superinterfaces.toList(); | 86 interfaces = superinterfaces.toList(); |
| 87 variables = createVariables( | 87 variables = createVariables( |
| 88 dart2js_util.variablesOf(classMirror.declarations), this); | 88 dart2js_util.variablesOf(classMirror.declarations), this); |
| 89 methods = createMethods(classMirror.declarations.values.where( | 89 methods = createMethods(dart2js_util.anyMethodOf(classMirror.declarations), |
| 90 (mirror) => mirror is MethodMirror), this); | 90 this); |
| 91 | 91 |
| 92 // Tell superclass that you are a subclass, unless you are not | 92 // Tell superclass that you are a subclass, unless you are not |
| 93 // visible or an intermediary mixin class. | 93 // visible or an intermediary mixin class. |
| 94 if (!classMirror.isNameSynthetic && isVisible && _superclass != null) { | 94 if (!classMirror.isNameSynthetic && isVisible && _superclass != null) { |
| 95 _superclass.addSubclass(this); | 95 _superclass.addSubclass(this); |
| 96 } | 96 } |
| 97 | 97 |
| 98 if (this._superclass != null) addInherited(_superclass); | 98 if (this._superclass != null) addInherited(_superclass); |
| 99 interfaces.forEach((interface) => addInherited(interface)); | 99 interfaces.forEach((interface) => addInherited(interface)); |
| 100 } | 100 } |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 'methods': expandMethodMap(methods), | 236 'methods': expandMethodMap(methods), |
| 237 'inheritedMethods': expandMethodMap(inheritedMethods), | 237 'inheritedMethods': expandMethodMap(inheritedMethods), |
| 238 'annotations': annotations.map((a) => a.toMap()).toList(), | 238 'annotations': annotations.map((a) => a.toMap()).toList(), |
| 239 'generics': recurseMap(generics) | 239 'generics': recurseMap(generics) |
| 240 }; | 240 }; |
| 241 | 241 |
| 242 int compareTo(Class other) => name.compareTo(other.name); | 242 int compareTo(Class other) => name.compareTo(other.name); |
| 243 | 243 |
| 244 bool isValidMirror(DeclarationMirror mirror) => mirror is ClassMirror; | 244 bool isValidMirror(DeclarationMirror mirror) => mirror is ClassMirror; |
| 245 } | 245 } |
| OLD | NEW |