Index: runtime/vm/mirrors_api_impl.cc |
diff --git a/runtime/vm/mirrors_api_impl.cc b/runtime/vm/mirrors_api_impl.cc |
index 673621dfa15de79dc7d696932cda209907417806..5a0174e8d5dedb232fc21af08e546cbd99e7ecf0 100644 |
--- a/runtime/vm/mirrors_api_impl.cc |
+++ b/runtime/vm/mirrors_api_impl.cc |
@@ -26,9 +26,8 @@ DART_EXPORT Dart_Handle Dart_ClassName(Dart_Handle object) { |
Isolate* isolate = Isolate::Current(); |
DARTSCOPE(isolate); |
const Object& obj = Object::Handle(isolate, Api::UnwrapHandle(object)); |
siva
2013/09/19 03:16:58
Ditto comment about using
const Type& type_obj = .
rmacnak
2013/09/19 17:45:53
Got 'em.
|
- if (obj.IsType() || obj.IsClass()) { |
- const Class& cls = (obj.IsType()) ? |
- Class::Handle(Type::Cast(obj).type_class()) : Class::Cast(obj); |
+ if (obj.IsType()) { |
+ const Class& cls = Class::Handle(Type::Cast(obj).type_class()); |
return Api::NewHandle(isolate, cls.UserVisibleName()); |
} else { |
RETURN_TYPE_ERROR(isolate, object, Class/Type); |
@@ -75,12 +74,8 @@ DART_EXPORT Dart_Handle Dart_GetFunctionNames(Dart_Handle target) { |
Function& func = Function::Handle(); |
String& name = String::Handle(); |
- if (obj.IsType() || obj.IsClass()) { |
- // For backwards compatibility we allow class objects to be passed in |
- // for now. This needs to be removed once all code that uses class |
- // objects to invoke Dart_Invoke is removed. |
- const Class& cls = (obj.IsType()) ? |
- Class::Handle(Type::Cast(obj).type_class()) : Class::Cast(obj); |
+ if (obj.IsType()) { |
+ const Class& cls = Class::Handle(Type::Cast(obj).type_class()); |
const Error& error = Error::Handle(isolate, cls.EnsureIsFinalized(isolate)); |
if (!error.IsNull()) { |
return Api::NewHandle(isolate, error.raw()); |
@@ -141,12 +136,8 @@ DART_EXPORT Dart_Handle Dart_LookupFunction(Dart_Handle target, |
Function& func = Function::Handle(isolate); |
String& tmp_name = String::Handle(isolate); |
- if (obj.IsType() || obj.IsClass()) { |
- // For backwards compatibility we allow class objects to be passed in |
- // for now. This needs to be removed once all code that uses class |
- // objects to invoke Dart_Invoke is removed. |
- const Class& cls = (obj.IsType()) ? |
- Class::Handle(Type::Cast(obj).type_class()) : Class::Cast(obj); |
+ if (obj.IsType()) { |
+ const Class& cls = Class::Handle(Type::Cast(obj).type_class()); |
// Case 1. Lookup the unmodified function name. |
func = cls.LookupFunctionAllowPrivate(func_name); |