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

Unified Diff: runtime/lib/object.cc

Issue 9317099: Improve repoorting of NoSuchMethod: (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 8 years, 10 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 | « corelib/src/exceptions.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/object.cc
===================================================================
--- runtime/lib/object.cc (revision 3959)
+++ runtime/lib/object.cc (working copy)
@@ -40,26 +40,14 @@
function = instance_class.LookupDynamicFunction(function_name);
}
if (!function.IsNull()) {
- String& tmp = String::Handle();
- String& extra_message = String::Handle();
- tmp = String::NewSymbol("\nFound '");
- extra_message = String::Concat(tmp, function_name);
- tmp = String::NewSymbol("(");
- extra_message = String::Concat(extra_message, tmp);
- const int total_num_paramaters =
+ const int total_num_parameters =
function.num_fixed_parameters() + function.num_optional_parameters();
- // 0 is the receiver ('this'), skip it.
- for (int i = 1; i < total_num_paramaters; i++) {
- if (i > 1) {
- tmp = String::NewSymbol(", ");
- extra_message = String::Concat(extra_message, tmp);
- }
- tmp = function.ParameterNameAt(i);
- extra_message = String::Concat(extra_message, tmp);
+ const Array& array = Array::Handle(Array::New(total_num_parameters - 1));
+ // Skip receiver.
+ for (int i = 1; i < total_num_parameters; i++) {
+ array.SetAt(i - 1, String::Handle(function.ParameterNameAt(i)));
}
- tmp = String::NewSymbol(")'");
- extra_message = String::Concat(extra_message, tmp);
- dart_arguments.Add(&extra_message);
+ dart_arguments.Add(&array);
}
Exceptions::ThrowByType(Exceptions::kNoSuchMethod, dart_arguments);
}
« no previous file with comments | « corelib/src/exceptions.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698