Chromium Code Reviews| Index: runtime/vm/dart_api_impl.cc |
| =================================================================== |
| --- runtime/vm/dart_api_impl.cc (revision 17169) |
| +++ runtime/vm/dart_api_impl.cc (working copy) |
| @@ -1104,15 +1104,19 @@ |
| ASSERT(!isolate_lib.IsNull()); |
| const String& class_name = String::Handle( |
| isolate, isolate_lib.PrivateName(Symbols::_ReceivePortImpl())); |
| + const Library& core_lib = Library::Handle(Library::CoreLibrary()); |
| + const String& function_name = |
| + String::Handle(core_lib.PrivateName(Symbols::_get_or_create())); |
|
siva
2013/01/16 23:57:24
Can we add a TODO here that private names in the s
Ivan Posva
2013/01/17 00:25:14
Using the core_lib private key does not seem appro
srdjan
2013/01/17 00:31:11
Done.
srdjan
2013/01/17 00:31:11
There are no tests apparently . Fixed, thanks for
|
| const int kNumArguments = 1; |
| const Function& function = Function::Handle( |
| isolate, |
| Resolver::ResolveStatic(isolate_lib, |
| class_name, |
| - Symbols::_get_or_create(), |
| + function_name, |
| kNumArguments, |
| Object::empty_array(), |
| Resolver::kIsQualified)); |
| + ASSERT(!function.IsNull()); |
| const Array& args = Array::Handle(isolate, Array::New(kNumArguments)); |
| args.SetAt(0, Integer::Handle(isolate, Integer::New(port_id))); |
| return Api::NewHandle(isolate, DartEntry::InvokeStatic(function, args)); |
| @@ -2783,7 +2787,7 @@ |
| const Class& cls = Class::Cast(obj); |
| // Case 1. Lookup the unmodified function name. |
| - func = cls.LookupFunction(func_name); |
| + func = cls.LookupFunctionAllowPrivate(func_name); |
| // Case 2. Lookup the function without the external setter suffix |
| // '='. Make sure to do this check after the regular lookup, so |
| @@ -2791,20 +2795,20 @@ |
| if (func.IsNull() && HasExternalSetterSuffix(func_name)) { |
| tmp_name = RemoveExternalSetterSuffix(func_name); |
| tmp_name = Field::SetterName(tmp_name); |
| - func = cls.LookupFunction(tmp_name); |
| + func = cls.LookupFunctionAllowPrivate(tmp_name); |
| } |
| // Case 3. Lookup the funciton with the getter prefix prepended. |
| if (func.IsNull()) { |
| tmp_name = Field::GetterName(func_name); |
| - func = cls.LookupFunction(tmp_name); |
| + func = cls.LookupFunctionAllowPrivate(tmp_name); |
| } |
| // Case 4. Lookup the function with a . appended to find the |
| // unnamed constructor. |
| if (func.IsNull()) { |
| tmp_name = String::Concat(func_name, Symbols::Dot()); |
| - func = cls.LookupFunction(tmp_name); |
| + func = cls.LookupFunctionAllowPrivate(tmp_name); |
| } |
| } else if (obj.IsLibrary()) { |
| const Library& lib = Library::Cast(obj); |
| @@ -3299,7 +3303,7 @@ |
| // The constructor must be present in the interface. |
| String& constr_name = String::Handle(String::Concat(class_name, dotted_name)); |
| const Function& constructor = |
| - Function::Handle(cls.LookupFunction(constr_name)); |
| + Function::Handle(cls.LookupFunctionAllowPrivate(constr_name)); |
| if (constructor.IsNull() || |
| (!constructor.IsConstructor() && !constructor.IsFactory())) { |
| const String& lookup_class_name = String::Handle(cls.Name()); |
| @@ -3611,7 +3615,7 @@ |
| while (!cls.IsNull()) { |
| String& getter_name = |
| String::Handle(isolate, Field::GetterName(field_name)); |
| - getter = cls.LookupDynamicFunction(getter_name); |
| + getter = cls.LookupDynamicFunctionAllowPrivate(getter_name); |
| if (!getter.IsNull()) { |
| break; |
| } |
| @@ -3642,7 +3646,7 @@ |
| if (field.IsNull() || FieldIsUninitialized(isolate, field)) { |
| const String& getter_name = |
| String::Handle(isolate, Field::GetterName(field_name)); |
| - getter = cls.LookupStaticFunction(getter_name); |
| + getter = cls.LookupStaticFunctionAllowPrivate(getter_name); |
| } |
| if (!getter.IsNull()) { |
| @@ -3674,7 +3678,7 @@ |
| const Class& cls = Class::Handle(isolate, field.owner()); |
| const String& getter_name = |
| String::Handle(isolate, Field::GetterName(field_name)); |
| - getter = cls.LookupStaticFunction(getter_name); |
| + getter = cls.LookupStaticFunctionAllowPrivate(getter_name); |
| } |
| if (!getter.IsNull()) { |
| @@ -3737,7 +3741,7 @@ |
| } |
| String& setter_name = |
| String::Handle(isolate, Field::SetterName(field_name)); |
| - setter = cls.LookupDynamicFunction(setter_name); |
| + setter = cls.LookupDynamicFunctionAllowPrivate(setter_name); |
| if (!setter.IsNull()) { |
| break; |
| } |
| @@ -3764,7 +3768,7 @@ |
| if (field.IsNull()) { |
| String& setter_name = |
| String::Handle(isolate, Field::SetterName(field_name)); |
| - setter = cls.LookupStaticFunction(setter_name); |
| + setter = cls.LookupStaticFunctionAllowPrivate(setter_name); |
| } |
| if (!setter.IsNull()) { |