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

Unified Diff: runtime/vm/code_generator.cc

Issue 14652008: Fix error reporting when calling static methods and closures withh mismatched arguments. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 8 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/object.cc ('k') | runtime/vm/dart_api_impl_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/code_generator.cc
===================================================================
--- runtime/vm/code_generator.cc (revision 22181)
+++ runtime/vm/code_generator.cc (working copy)
@@ -1086,7 +1086,14 @@
const Array& orig_arguments_desc = Array::CheckedHandle(arguments.ArgAt(2));
const Array& orig_arguments = Array::CheckedHandle(arguments.ArgAt(3));
- const String& original_function_name = String::Handle(ic_data.target_name());
+ String& original_function_name = String::Handle(ic_data.target_name());
+ if (receiver.IsClosure()) {
+ // For closure the function name is always 'call'. Replace it with the
+ // name of the closurized function so that exception contains more
+ // relevant information.
+ const Function& function = Function::Handle(Closure::function(receiver));
+ original_function_name = function.QualifiedUserVisibleName();
+ }
const Object& result = Object::Handle(
DartEntry::InvokeNoSuchMethod(receiver,
original_function_name,
« no previous file with comments | « runtime/lib/object.cc ('k') | runtime/vm/dart_api_impl_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698