| Index: packages/quiver/lib/mirrors.dart
|
| diff --git a/packages/quiver/lib/mirrors.dart b/packages/quiver/lib/mirrors.dart
|
| index 9f73e9fa9bb9c8ac6bfea6fd388aff24247a6bb6..b377f4c82a535f3afcd2f3e07c48f8ce46358247 100644
|
| --- a/packages/quiver/lib/mirrors.dart
|
| +++ b/packages/quiver/lib/mirrors.dart
|
| @@ -16,21 +16,15 @@ library quiver.mirrors;
|
|
|
| import 'dart:mirrors';
|
|
|
| -/**
|
| - * Returns the qualified name of [t].
|
| - */
|
| +/// Returns the qualified name of [t].
|
| Symbol getTypeName(Type t) => reflectClass(t).qualifiedName;
|
|
|
| -/**
|
| - * Returns true if [o] implements [type].
|
| - */
|
| +/// Returns true if [o] implements [type].
|
| bool implements(Object o, Type type) =>
|
| classImplements(reflect(o).type, reflectClass(type));
|
|
|
| -/**
|
| - * Returns true if the class represented by [classMirror] implements the class
|
| - * represented by [interfaceMirror].
|
| - */
|
| +/// Returns true if the class represented by [classMirror] implements the class
|
| +/// represented by [interfaceMirror].
|
| bool classImplements(ClassMirror classMirror, ClassMirror interfaceMirror) {
|
| if (classMirror == null) return false;
|
| // TODO: change to comparing mirrors when dartbug.com/19781 is fixed
|
| @@ -41,13 +35,11 @@ bool classImplements(ClassMirror classMirror, ClassMirror interfaceMirror) {
|
| return false;
|
| }
|
|
|
| -/**
|
| - * Walks up the class hierarchy to find a method declaration with the given
|
| - * [name].
|
| - *
|
| - * Note that it's not possible to tell if there's an implementation via
|
| - * noSuchMethod().
|
| - */
|
| +/// Walks up the class hierarchy to find a method declaration with the given
|
| +/// [name].
|
| +///
|
| +/// Note that it's not possible to tell if there's an implementation via
|
| +/// noSuchMethod().
|
| DeclarationMirror getDeclaration(ClassMirror classMirror, Symbol name) {
|
| if (classMirror.declarations.containsKey(name)) {
|
| return classMirror.declarations[name];
|
| @@ -67,9 +59,7 @@ DeclarationMirror getDeclaration(ClassMirror classMirror, Symbol name) {
|
| return null;
|
| }
|
|
|
| -/**
|
| - * Closurzes a method reflectively.
|
| - */
|
| +/// Closurizes a method reflectively.
|
| class Method /* implements Function */ {
|
| final InstanceMirror mirror;
|
| final Symbol symbol;
|
| @@ -80,8 +70,9 @@ class Method /* implements Function */ {
|
| if (i.isMethod && i.memberName == const Symbol('call')) {
|
| if (i.namedArguments != null && i.namedArguments.isNotEmpty) {
|
| // this will fail until named argument support is implemented
|
| - return mirror.invoke(
|
| - symbol, i.positionalArguments, i.namedArguments).reflectee;
|
| + return mirror
|
| + .invoke(symbol, i.positionalArguments, i.namedArguments)
|
| + .reflectee;
|
| }
|
| return mirror.invoke(symbol, i.positionalArguments).reflectee;
|
| }
|
|
|