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

Unified Diff: runtime/lib/object.cc

Issue 10034026: Add optional arguments to NullPointerException so that it can report more information (make it simi… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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
« corelib/src/exceptions.dart ('K') | « 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 6423)
+++ runtime/lib/object.cc (working copy)
@@ -19,16 +19,19 @@
DEFINE_NATIVE_ENTRY(Object_noSuchMethod, 3) {
const Instance& instance = Instance::CheckedHandle(arguments->At(0));
+ GET_NATIVE_ARGUMENT(String, function_name, arguments->At(1));
+ GET_NATIVE_ARGUMENT(Array, func_args, arguments->At(2));
if (instance.IsNull()) {
GrowableArray<const Object*> args;
+ args.Add(&function_name);
+ args.Add(&func_args);
Exceptions::ThrowByType(Exceptions::kNullPointer, args);
}
- GET_NATIVE_ARGUMENT(String, function_name, arguments->At(1));
- GET_NATIVE_ARGUMENT(Array, func_args, arguments->At(2));
GrowableArray<const Object*> dart_arguments(3);
dart_arguments.Add(&instance);
dart_arguments.Add(&function_name);
dart_arguments.Add(&func_args);
+
// Report if a function with same name (but different arguments) has been
// found.
Class& instance_class = Class::Handle(instance.clazz());
« corelib/src/exceptions.dart ('K') | « corelib/src/exceptions.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698