| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 |
| 5 library docgen.models.closure; |
| 6 |
| 7 import '../exports/source_mirrors.dart'; |
| 8 |
| 9 import 'doc_gen_type.dart'; |
| 10 import 'indexable.dart'; |
| 11 import 'mirror_based.dart'; |
| 12 import 'model_helpers.dart'; |
| 13 import 'parameter.dart'; |
| 14 |
| 15 /// A class containing the properties of a function to be called (used in our |
| 16 /// case specifically to illustrate evidence of the type of function for a |
| 17 /// parameter). |
| 18 class Closure extends MirrorBased<FunctionTypeMirror> { |
| 19 |
| 20 /// Parameters for this method. |
| 21 final Map<String, Parameter> parameters; |
| 22 final DocGenType returnType; |
| 23 final FunctionTypeMirror mirror; |
| 24 |
| 25 Closure(FunctionTypeMirror mirror, Indexable owner) |
| 26 : returnType = new DocGenType(mirror.returnType, owner.owningLibrary), |
| 27 parameters = createParameters(mirror.parameters, owner), |
| 28 mirror = mirror; |
| 29 |
| 30 /// Generates a map describing the [Method] object. |
| 31 Map toMap() => { |
| 32 'return': [returnType.toMap()], |
| 33 'parameters': recurseMap(parameters), |
| 34 }; |
| 35 } |
| OLD | NEW |