| Index: vm/code_generator.cc
|
| ===================================================================
|
| --- vm/code_generator.cc (revision 713)
|
| +++ vm/code_generator.cc (working copy)
|
| @@ -602,7 +602,10 @@
|
| return; // Return closure object.
|
| }
|
| }
|
| - Exceptions::ThrowByType(Exceptions::kObjectNotClosure, invoke_arguments);
|
| + Exceptions::ThrowByType(
|
| + result.IsNull() ? Exceptions::kNullPointer :
|
| + Exceptions::kObjectNotClosure,
|
| + invoke_arguments);
|
| }
|
|
|
|
|
| @@ -726,6 +729,10 @@
|
| ASSERT(arguments.Count() ==
|
| kReportObjectNotClosureRuntimeEntry.argument_count());
|
| const Instance& bad_closure = Instance::CheckedHandle(arguments.At(0));
|
| + if (bad_closure.IsNull()) {
|
| + GrowableArray<const Object*> args;
|
| + Exceptions::ThrowByType(Exceptions::kNullPointer, args);
|
| + }
|
| // const Array& arguments = Array::CheckedHandle(arguments.At(1));
|
| OS::PrintErr("object '%s' is not a closure\n", bad_closure.ToCString());
|
| GrowableArray<const Object*> args;
|
|
|