| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "include/dart_mirrors_api.h" | 5 #include "include/dart_mirrors_api.h" |
| 6 | 6 |
| 7 #include "platform/assert.h" | 7 #include "platform/assert.h" |
| 8 #include "vm/class_finalizer.h" | 8 #include "vm/class_finalizer.h" |
| 9 #include "vm/dart.h" | 9 #include "vm/dart.h" |
| 10 #include "vm/dart_api_impl.h" | 10 #include "vm/dart_api_impl.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 DART_EXPORT Dart_Handle Dart_QualifiedTypeName(Dart_Handle object) { | 40 DART_EXPORT Dart_Handle Dart_QualifiedTypeName(Dart_Handle object) { |
| 41 DARTSCOPE(Thread::Current()); | 41 DARTSCOPE(Thread::Current()); |
| 42 const Object& obj = Object::Handle(Z, Api::UnwrapHandle(object)); | 42 const Object& obj = Object::Handle(Z, Api::UnwrapHandle(object)); |
| 43 if (obj.IsType() || obj.IsClass()) { | 43 if (obj.IsType() || obj.IsClass()) { |
| 44 const Class& cls = (obj.IsType()) ? | 44 const Class& cls = (obj.IsType()) ? |
| 45 Class::Handle(Z, Type::Cast(obj).type_class()) : Class::Cast(obj); | 45 Class::Handle(Z, Type::Cast(obj).type_class()) : Class::Cast(obj); |
| 46 const char* str = cls.ToCString(); | 46 const char* str = cls.ToCString(); |
| 47 if (str == NULL) { | 47 if (str == NULL) { |
| 48 RETURN_NULL_ERROR(str); | 48 RETURN_NULL_ERROR(str); |
| 49 } | 49 } |
| 50 CHECK_CALLBACK_STATE(I); | 50 CHECK_CALLBACK_STATE(T); |
| 51 return Api::NewHandle(I, String::New(str)); | 51 return Api::NewHandle(I, String::New(str)); |
| 52 } else { | 52 } else { |
| 53 RETURN_TYPE_ERROR(Z, object, Class/Type); | 53 RETURN_TYPE_ERROR(Z, object, Class/Type); |
| 54 } | 54 } |
| 55 } | 55 } |
| 56 | 56 |
| 57 | 57 |
| 58 // --- Function and Variable Reflection --- | 58 // --- Function and Variable Reflection --- |
| 59 | 59 |
| 60 // Outside of the vm, we expose setter names with a trailing '='. | 60 // Outside of the vm, we expose setter names with a trailing '='. |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 360 RETURN_TYPE_ERROR(Z, closure, Instance); | 360 RETURN_TYPE_ERROR(Z, closure, Instance); |
| 361 } | 361 } |
| 362 | 362 |
| 363 ASSERT(ClassFinalizer::AllClassesFinalized()); | 363 ASSERT(ClassFinalizer::AllClassesFinalized()); |
| 364 | 364 |
| 365 RawFunction* rf = Closure::function(closure_obj); | 365 RawFunction* rf = Closure::function(closure_obj); |
| 366 return Api::NewHandle(I, rf); | 366 return Api::NewHandle(I, rf); |
| 367 } | 367 } |
| 368 | 368 |
| 369 } // namespace dart | 369 } // namespace dart |
| OLD | NEW |