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

Unified Diff: runtime/vm/resolver.cc

Issue 10849004: Fix super getter/setter (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 4 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') | tests/co19/co19-runtime.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/resolver.cc
===================================================================
--- runtime/vm/resolver.cc (revision 10409)
+++ runtime/vm/resolver.cc (working copy)
@@ -45,21 +45,10 @@
const String& function_name,
int num_arguments,
int num_named_arguments) {
- Class& cls = Class::Handle(receiver_class.raw());
- if (FLAG_trace_resolving) {
- OS::Print("ResolveDynamic '%s' for class %s\n",
- function_name.ToCString(), String::Handle(cls.Name()).ToCString());
- }
- // Now look for an instance function whose name matches function_name
- // in the class.
Function& function =
- Function::Handle(cls.LookupDynamicFunction(function_name));
- while (function.IsNull()) {
- cls = cls.SuperClass();
- if (cls.IsNull()) break;
- function = cls.LookupDynamicFunction(function_name);
- }
+ Function::Handle(ResolveDynamicAnyArgs(receiver_class, function_name));
+
if (function.IsNull() ||
!function.AreValidArgumentCounts(num_arguments,
num_named_arguments,
@@ -84,6 +73,28 @@
}
+RawFunction* Resolver::ResolveDynamicAnyArgs(
+ const Class& receiver_class,
+ const String& function_name) {
+ Class& cls = Class::Handle(receiver_class.raw());
+ if (FLAG_trace_resolving) {
+ OS::Print("ResolveDynamic '%s' for class %s\n",
+ function_name.ToCString(),
+ String::Handle(cls.Name()).ToCString());
+ }
+ // Now look for an instance function whose name matches function_name
+ // in the class.
+ Function& function =
+ Function::Handle(cls.LookupDynamicFunction(function_name));
+ while (function.IsNull()) {
+ cls = cls.SuperClass();
+ if (cls.IsNull()) break;
+ function = cls.LookupDynamicFunction(function_name);
+ }
+ return function.raw();
+}
+
+
RawFunction* Resolver::ResolveStatic(const Library& library,
const String& class_name,
const String& function_name,
« no previous file with comments | « runtime/vm/resolver.h ('k') | tests/co19/co19-runtime.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698