| Index: sdk/lib/_internal/compiler/implementation/mirrors/dart2js_type_mirrors.dart
|
| diff --git a/sdk/lib/_internal/compiler/implementation/mirrors/dart2js_type_mirrors.dart b/sdk/lib/_internal/compiler/implementation/mirrors/dart2js_type_mirrors.dart
|
| index 8a5a41e33ceb4d163611228ce46590b3b8069f09..3652f00397dfb09474694e907ebc976321cd9e55 100644
|
| --- a/sdk/lib/_internal/compiler/implementation/mirrors/dart2js_type_mirrors.dart
|
| +++ b/sdk/lib/_internal/compiler/implementation/mirrors/dart2js_type_mirrors.dart
|
| @@ -54,6 +54,14 @@ abstract class Dart2JsTypeMirror
|
|
|
| bool get isDynamic => false;
|
|
|
| + bool isSubtypeOf(TypeMirror other) {
|
| + return mirrorSystem.compiler.types.isSubtype(this._type, other._type);
|
| + }
|
| +
|
| + bool isAssignableTo(TypeMirror other) {
|
| + return mirrorSystem.compiler.types.isAssignable(this._type, other._type);
|
| + }
|
| +
|
| String toString() => _type.toString();
|
| }
|
|
|
| @@ -226,6 +234,18 @@ class Dart2JsClassDeclarationMirror
|
| InterfaceType type)
|
| : super(system, type);
|
|
|
| + bool isSubclassOf(ClassMirror other) {
|
| + if (other is! ClassMirror) throw new ArgumentError(other);
|
| + ClassMirror otherDeclaration = other.originalDeclaration;
|
| + ClassMirror c = this;
|
| + while (c != null) {
|
| + c = c.originalDeclaration;
|
| + if (c == otherDeclaration) return true;
|
| + c = c.superclass;
|
| + }
|
| + return false;
|
| + }
|
| +
|
| String toString() => 'Mirror on class ${_type.name}';
|
| }
|
|
|
|
|