Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(228)

Unified Diff: sdk/lib/_internal/lib/js_mirrors.dart

Issue 126823004: Add TypeMirror.isSubtypeOf, TypeMirror.isAssignableTo, ClassMirror.isSubclassOf (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: mark source mirrors as failing Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: sdk/lib/_internal/lib/js_mirrors.dart
diff --git a/sdk/lib/_internal/lib/js_mirrors.dart b/sdk/lib/_internal/lib/js_mirrors.dart
index 067b61633620b80888548e8e3af49fdd3203870b..a5ee2bf57d38b40cc9250e624446728edc64a0e6 100644
--- a/sdk/lib/_internal/lib/js_mirrors.dart
+++ b/sdk/lib/_internal/lib/js_mirrors.dart
@@ -227,6 +227,9 @@ class JsTypeVariableMirror extends JsTypeMirror implements TypeVariableMirror {
owner, getMetadata(_typeVariable.bound));
}
+ bool isSubtypeOf(TypeMirror other) => throw new UnimplementedError();
+ bool isAssignableTo(TypeMirror other) => throw new UnimplementedError();
+
_asRuntimeType() => _metadataIndex;
}
@@ -255,6 +258,9 @@ class JsTypeMirror extends JsDeclarationMirror implements TypeMirror {
bool get isOriginalDeclaration => true;
TypeMirror get originalDeclaration => this;
+ bool isSubtypeOf(TypeMirror other) => throw new UnimplementedError();
+ bool isAssignableTo(TypeMirror other) => throw new UnimplementedError();
+
_asRuntimeType() {
if (this == JsMirrorSystem._dynamicType) return null;
if (this == JsMirrorSystem._voidType) return null;
@@ -791,6 +797,10 @@ class JsMixinApplication extends JsTypeMirror with JsObjectMirror
Function operator [](Symbol name) => throw new UnimplementedError();
bool get isAbstract => throw new UnimplementedError();
+
+ bool isSubclassOf(ClassMirror other) => throw new UnimplementedError();
+ bool isSubtypeOf(TypeMirror other) => throw new UnimplementedError();
+ bool isAssignableTo(TypeMirror other) => throw new UnimplementedError();
}
abstract class JsObjectMirror implements ObjectMirror {
@@ -1364,6 +1374,8 @@ class JsTypeBoundClassMirror extends JsDeclarationMirror
bool get isAbstract => _class.isAbstract;
+ bool isSubclassOf(ClassMirror other) => _class.isSubclassOf(other);
+
SourceLocation get location => _class.location;
MirrorSystem get mirrors => _class.mirrors;
@@ -1381,6 +1393,9 @@ class JsTypeBoundClassMirror extends JsDeclarationMirror
// TODO(ahe): Implement this.
Function operator [](Symbol name) => throw new UnimplementedError();
+
+ bool isSubtypeOf(TypeMirror other) => throw new UnimplementedError();
+ bool isAssignableTo(TypeMirror other) => throw new UnimplementedError();
}
class JsSyntheticAccessor implements MethodMirror {
@@ -1887,6 +1902,8 @@ class JsClassMirror extends JsTypeMirror with JsObjectMirror
Function operator [](Symbol name) => throw new UnimplementedError();
bool get isAbstract => throw new UnimplementedError();
+
+ bool isSubclassOf(ClassMirror other) => throw new UnimplementedError();
}
class JsVariableMirror extends JsDeclarationMirror implements VariableMirror {
@@ -2332,6 +2349,9 @@ class JsTypedefMirror extends JsDeclarationMirror implements TypedefMirror {
// TODO(ahe): Implement this method.
List<InstanceMirror> get metadata => throw new UnimplementedError();
+
+ bool isSubtypeOf(TypeMirror other) => throw new UnimplementedError();
+ bool isAssignableTo(TypeMirror other) => throw new UnimplementedError();
}
// TODO(ahe): Remove this class when API is updated.
@@ -2473,6 +2493,10 @@ class JsFunctionTypeMirror extends BrokenClassMirror
return _cachedToString = "$s'";
}
+ bool isSubclassOf(ClassMirror other) => throw new UnimplementedError();
+ bool isSubtypeOf(TypeMirror other) => throw new UnimplementedError();
+ bool isAssignableTo(TypeMirror other) => throw new UnimplementedError();
+
// TODO(ahe): Implement this method.
MethodMirror get callMethod => throw new UnimplementedError();
}
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/mirrors/dart2js_type_mirrors.dart ('k') | sdk/lib/mirrors/mirrors.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698