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

Unified Diff: runtime/lib/mirrors.cc

Issue 23484020: Update handling of ambiguous name references (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 3 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
« no previous file with comments | « runtime/lib/isolate.cc ('k') | runtime/vm/cha_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/mirrors.cc
===================================================================
--- runtime/lib/mirrors.cc (revision 27310)
+++ runtime/lib/mirrors.cc (working copy)
@@ -1211,15 +1211,9 @@
const Array& args_descriptor_array =
Array::Handle(ArgumentsDescriptor::New(args.Length(), arg_names));
- String& ambiguity_error_msg = String::Handle(isolate);
const Function& function = Function::Handle(
- library.LookupFunctionAllowPrivate(function_name, &ambiguity_error_msg));
+ library.LookupFunctionAllowPrivate(function_name));
- if (function.IsNull() && !ambiguity_error_msg.IsNull()) {
- ThrowMirroredCompilationError(ambiguity_error_msg);
- UNREACHABLE();
- }
-
ArgumentsDescriptor args_descriptor(args_descriptor_array);
if (function.IsNull() ||
!function.AreValidArguments(args_descriptor, NULL) ||
@@ -1253,16 +1247,14 @@
// To access a top-level we may need to use the Field or the
// getter Function. The getter function may either be in the
// library or in the field's owner class, depending.
- String& ambiguity_error_msg = String::Handle(isolate);
const Field& field = Field::Handle(
- library.LookupFieldAllowPrivate(getter_name, &ambiguity_error_msg));
+ library.LookupFieldAllowPrivate(getter_name));
Function& getter = Function::Handle();
- if (field.IsNull() && ambiguity_error_msg.IsNull()) {
+ if (field.IsNull()) {
// No field found and no ambiguity error. Check for a getter in the lib.
const String& internal_getter_name =
String::Handle(Field::GetterName(getter_name));
- getter = library.LookupFunctionAllowPrivate(internal_getter_name,
- &ambiguity_error_msg);
+ getter = library.LookupFunctionAllowPrivate(internal_getter_name);
} else if (!field.IsNull() && FieldIsUninitialized(field)) {
// A field was found. Check for a getter in the field's owner classs.
const Class& klass = Class::Handle(field.owner());
@@ -1284,15 +1276,11 @@
if (!field.IsNull()) {
return field.value();
}
- if (ambiguity_error_msg.IsNull()) {
- ThrowNoSuchMethod(Instance::null_instance(),
- getter_name,
- getter,
- InvocationMirror::kTopLevel,
- InvocationMirror::kGetter);
- } else {
- ThrowMirroredCompilationError(ambiguity_error_msg);
- }
+ ThrowNoSuchMethod(Instance::null_instance(),
+ getter_name,
+ getter,
+ InvocationMirror::kTopLevel,
+ InvocationMirror::kGetter);
UNREACHABLE();
return Instance::null();
}
@@ -1310,26 +1298,20 @@
// To access a top-level we may need to use the Field or the
// setter Function. The setter function may either be in the
// library or in the field's owner class, depending.
- String& ambiguity_error_msg = String::Handle(isolate);
const Field& field = Field::Handle(
- library.LookupFieldAllowPrivate(setter_name, &ambiguity_error_msg));
+ library.LookupFieldAllowPrivate(setter_name));
- if (field.IsNull() && ambiguity_error_msg.IsNull()) {
+ if (field.IsNull()) {
const String& internal_setter_name =
String::Handle(Field::SetterName(setter_name));
const Function& setter = Function::Handle(
- library.LookupFunctionAllowPrivate(internal_setter_name,
- &ambiguity_error_msg));
+ library.LookupFunctionAllowPrivate(internal_setter_name));
if (setter.IsNull() || !setter.is_visible()) {
- if (ambiguity_error_msg.IsNull()) {
- ThrowNoSuchMethod(Instance::null_instance(),
- setter_name,
- setter,
- InvocationMirror::kTopLevel,
- InvocationMirror::kSetter);
- } else {
- ThrowMirroredCompilationError(ambiguity_error_msg);
- }
+ ThrowNoSuchMethod(Instance::null_instance(),
+ setter_name,
+ setter,
+ InvocationMirror::kTopLevel,
+ InvocationMirror::kSetter);
UNREACHABLE();
}
« no previous file with comments | « runtime/lib/isolate.cc ('k') | runtime/vm/cha_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698