Index: runtime/vm/resolver.cc |
diff --git a/runtime/vm/resolver.cc b/runtime/vm/resolver.cc |
index 2109dddd9f3097a95735759b1a26135da7bff2bd..7274efa4cfb5db44646b477daa0aa96a82842637 100644 |
--- a/runtime/vm/resolver.cc |
+++ b/runtime/vm/resolver.cc |
@@ -221,4 +221,36 @@ RawFunction* Resolver::ResolveStatic(const Class& cls, |
return function.raw(); |
} |
+ |
+RawFunction* Resolver::ResolveStaticAllowPrivate(const Class& cls, |
+ const String& function_name, |
+ intptr_t num_arguments, |
+ const Array& argument_names) { |
+ ASSERT(!cls.IsNull()); |
+ if (FLAG_trace_resolving) { |
+ OS::Print("ResolveStaticAllowPrivate '%s'\n", function_name.ToCString()); |
+ } |
+ const Function& function = |
+ Function::Handle(cls.LookupStaticFunctionAllowPrivate(function_name)); |
+ if (function.IsNull() || |
+ !function.AreValidArguments(num_arguments, argument_names, NULL)) { |
+ // Return a null function to signal to the upper levels to throw a |
+ // resolution error or maybe throw the error right here. |
+ if (FLAG_trace_resolving) { |
+ String& error_message = String::Handle(String::New("function not found")); |
+ if (!function.IsNull()) { |
+ // Obtain more detailed error message. |
+ function.AreValidArguments(num_arguments, |
+ argument_names, |
+ &error_message); |
+ } |
+ OS::Print("ResolveStaticAllowPrivate error '%s': %s.\n", |
+ function_name.ToCString(), |
+ error_message.ToCString()); |
+ } |
+ return Function::null(); |
+ } |
+ return function.raw(); |
+} |
+ |
} // namespace dart |