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

Unified Diff: runtime/lib/mirrors.cc

Issue 126823004: Add TypeMirror.isSubtypeOf, TypeMirror.isAssignableTo, ClassMirror.isSubclassOf (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: +source mirrors 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
« no previous file with comments | « no previous file | runtime/lib/mirrors_impl.dart » ('j') | tests/lib/mirrors/relation_assignable_test.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/mirrors.cc
diff --git a/runtime/lib/mirrors.cc b/runtime/lib/mirrors.cc
index 9f5c7634be0c0632f0e48c6c48bd960eb6d520c7..a535d63cd5592e8b39d6ce65955052466df39a20 100644
--- a/runtime/lib/mirrors.cc
+++ b/runtime/lib/mirrors.cc
@@ -2095,4 +2095,17 @@ DEFINE_NATIVE_ENTRY(VariableMirror_type, 2) {
return InstantiateType(type, instantiator);
}
+DEFINE_NATIVE_ENTRY(TypeMirror_subtypeTest, 2) {
+ GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, a, arguments->NativeArgAt(0));
+ GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, b, arguments->NativeArgAt(1));
+ return Bool::Get(a.IsSubtypeOf(b, NULL)).raw();
+}
+
+DEFINE_NATIVE_ENTRY(TypeMirror_moreSpecificTest, 2) {
+ GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, a, arguments->NativeArgAt(0));
+ GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, b, arguments->NativeArgAt(1));
+ return Bool::Get(a.IsMoreSpecificThan(b, NULL)).raw();
+}
+
+
} // namespace dart
« no previous file with comments | « no previous file | runtime/lib/mirrors_impl.dart » ('j') | tests/lib/mirrors/relation_assignable_test.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698