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

Unified Diff: runtime/vm/resolver.cc

Issue 891053004: Make Dart_Invoke work for private static functions (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 11 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/vm/resolver.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « runtime/vm/resolver.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698