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

Unified Diff: runtime/vm/dart_api_impl.cc

Issue 1868803002: Use symbols when looking up fields in a class (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 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
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());
« no previous file with comments | « runtime/lib/mirrors.cc ('k') | runtime/vm/debugger.cc » ('j') | runtime/vm/object.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698