Index: runtime/vm/dart_api_impl.cc |
diff --git a/runtime/vm/dart_api_impl.cc b/runtime/vm/dart_api_impl.cc |
index fd0050dd4dc4337688e6d8b605c4a683eed16571..3bd60d9f808f228bbd42c4c13d5be27edc86e39a 100644 |
--- a/runtime/vm/dart_api_impl.cc |
+++ b/runtime/vm/dart_api_impl.cc |
@@ -4262,7 +4262,7 @@ DART_EXPORT Dart_Handle Dart_GetField(Dart_Handle container, Dart_Handle name) { |
// getter Function. |
Class& cls = Class::Handle(Z, Type::Cast(obj).type_class()); |
- field = cls.LookupStaticField(field_name); |
+ field = cls.LookupStaticFieldAllowPrivate(field_name); |
if (field.IsNull() || field.IsUninitialized()) { |
const String& getter_name = |
String::Handle(Z, Field::GetterName(field_name)); |
@@ -4392,7 +4392,7 @@ DART_EXPORT Dart_Handle Dart_SetField(Dart_Handle container, |
// setter Function. |
Class& cls = Class::Handle(Z, Type::Cast(obj).type_class()); |
- field = cls.LookupStaticField(field_name); |
+ field = cls.LookupStaticFieldAllowPrivate(field_name); |
if (field.IsNull()) { |
String& setter_name = String::Handle(Z, Field::SetterName(field_name)); |
setter = cls.LookupStaticFunctionAllowPrivate(setter_name); |
@@ -4431,7 +4431,7 @@ DART_EXPORT Dart_Handle Dart_SetField(Dart_Handle container, |
Class& cls = Class::Handle(Z, instance.clazz()); |
String& setter_name = String::Handle(Z, Field::SetterName(field_name)); |
while (!cls.IsNull()) { |
- field = cls.LookupInstanceField(field_name); |
+ field = cls.LookupInstanceFieldAllowPrivate(field_name); |
if (!field.IsNull() && field.is_final()) { |
return Api::NewError("%s: cannot set final field '%s'.", |
CURRENT_FUNC, field_name.ToCString()); |