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

Unified Diff: runtime/vm/mirrors_api_impl.cc

Issue 23851038: Add Dart_QualifiedClassName. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 3 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 | « runtime/vm/dart_api_impl_test.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/mirrors_api_impl.cc
diff --git a/runtime/vm/mirrors_api_impl.cc b/runtime/vm/mirrors_api_impl.cc
index 4fd535fba1e6611493a5d26129f8d370bb40cba4..a245cee447614e47679433e5b11d2da240c17d4e 100644
--- a/runtime/vm/mirrors_api_impl.cc
+++ b/runtime/vm/mirrors_api_impl.cc
@@ -35,6 +35,19 @@ DART_EXPORT Dart_Handle Dart_ClassName(Dart_Handle object) {
}
}
+DART_EXPORT Dart_Handle Dart_QualifiedClassName(Dart_Handle object) {
+ Isolate* isolate = Isolate::Current();
+ DARTSCOPE(isolate);
+ const Object& obj = Object::Handle(isolate, Api::UnwrapHandle(object));
+ if (obj.IsType() || obj.IsClass()) {
+ const Class& cls = (obj.IsType()) ?
+ Class::Handle(Type::Cast(obj).type_class()) : Class::Cast(obj);
+ return Dart_NewStringFromCString(cls.ToCString());
+ } else {
+ RETURN_TYPE_ERROR(isolate, object, Class/Type);
+ }
+}
+
// --- Function and Variable Reflection ---
// Outside of the vm, we expose setter names with a trailing '='.
« no previous file with comments | « runtime/vm/dart_api_impl_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698