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

Unified Diff: runtime/lib/mirrors.cc

Issue 14118011: - Implement reflectClass. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 8 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') | runtime/lib/mirrors_patch.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/mirrors.cc
===================================================================
--- runtime/lib/mirrors.cc (revision 21604)
+++ runtime/lib/mirrors.cc (working copy)
@@ -5,6 +5,7 @@
#include "include/dart_api.h"
#include "include/dart_debugger_api.h"
#include "platform/json.h"
+#include "vm/dart_api_impl.h"
#include "vm/bootstrap_natives.h"
#include "vm/dart_entry.h"
#include "vm/exceptions.h"
@@ -1073,6 +1074,43 @@
}
+void NATIVE_ENTRY_FUNCTION(Mirrors_makeLocalClassMirror)(
+ Dart_NativeArguments args) {
+ Dart_EnterScope();
+ Isolate* isolate = Isolate::Current();
+ Dart_Handle key = Dart_GetNativeArgument(args, 0);
+ if (Dart_IsError(key)) {
+ Dart_PropagateError(key);
+ }
+ const Type& type = Api::UnwrapTypeHandle(isolate, key);
+ const Class& cls = Class::Handle(type.type_class());
+ Dart_Handle cls_handle = Api::NewHandle(isolate, cls.raw());
+ if (Dart_IsError(cls_handle)) {
+ Dart_PropagateError(cls_handle);
+ }
+ Dart_Handle name_handle = Api::NewHandle(isolate, cls.Name());
+ if (Dart_IsError(name_handle)) {
+ Dart_PropagateError(name_handle);
+ }
+ Dart_Handle lib_handle = Api::NewHandle(isolate, cls.library());
+ if (Dart_IsError(lib_handle)) {
+ Dart_PropagateError(lib_handle);
+ }
+ Dart_Handle lib_mirror = CreateLibraryMirror(lib_handle);
+ if (Dart_IsError(lib_mirror)) {
+ Dart_PropagateError(lib_mirror);
+ }
+ Dart_Handle result = CreateClassMirror(cls_handle,
+ name_handle,
+ lib_handle,
+ lib_mirror);
+ if (Dart_IsError(result)) {
+ Dart_PropagateError(result);
+ }
+ Dart_SetReturnValue(args, result);
+ Dart_ExitScope();
+}
+
void NATIVE_ENTRY_FUNCTION(LocalObjectMirrorImpl_invoke)(
Dart_NativeArguments args) {
Dart_EnterScope();
« no previous file with comments | « no previous file | runtime/lib/mirrors_impl.dart » ('j') | runtime/lib/mirrors_patch.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698